org.compass.core.impl
Class DefaultCompassHit

java.lang.Object
  extended by org.compass.core.impl.DefaultCompassHit
All Implemented Interfaces:
Serializable, CompassHit

public class DefaultCompassHit
extends Object
implements CompassHit

Author:
kimchy
See Also:
Serialized Form

Constructor Summary
DefaultCompassHit(CompassHitsOperations compassHits, int hitNumber)
           
 
Method Summary
 String alias()
          Same as CompassHit.getAlias().
 Object data()
          Same as CompassHit.getData() just shorter.
 String getAlias()
          Returns the alias value of the hit.
 Object getData()
          Returns the object for this hit.
 CompassHighlightedText getHighlightedText()
          Returns a cached highlighted text the maps to the hit.
 Resource getResource()
          Returns the Resource for this hit.
 float getScore()
          Returns the score for this hit.
 CompassHighlightedText highlightedText()
          Same as CompassHit.getHighlightedText().
 Resource resource()
          Same as CompassHit.getResource().
 float score()
          Same as CompassHit.getScore().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCompassHit

DefaultCompassHit(CompassHitsOperations compassHits,
                  int hitNumber)
Method Detail

getData

public Object getData()
Description copied from interface: CompassHit
Returns the object for this hit.

Specified by:
getData in interface CompassHit
Returns:
The object data of the hit.
See Also:
CompassHitsOperations.data(int)

data

public Object data()
            throws CompassException
Description copied from interface: CompassHit
Same as CompassHit.getData() just shorter.

Specified by:
data in interface CompassHit
Throws:
CompassException

getResource

public Resource getResource()
                     throws CompassException
Description copied from interface: CompassHit
Returns the Resource for this hit.

Specified by:
getResource in interface CompassHit
Returns:
The Resource of the hit.
Throws:
CompassException
See Also:
CompassHitsOperations.resource(int)

resource

public Resource resource()
                  throws CompassException
Description copied from interface: CompassHit
Same as CompassHit.getResource().

Specified by:
resource in interface CompassHit
Throws:
CompassException

getScore

public float getScore()
               throws CompassException
Description copied from interface: CompassHit
Returns the score for this hit.

Specified by:
getScore in interface CompassHit
Returns:
The score of the hit.
Throws:
CompassException
See Also:
CompassHitsOperations.score(int)

score

public float score()
            throws CompassException
Description copied from interface: CompassHit
Same as CompassHit.getScore().

Specified by:
score in interface CompassHit
Throws:
CompassException

getHighlightedText

public CompassHighlightedText getHighlightedText()
                                          throws CompassException
Description copied from interface: CompassHit
Returns a cached highlighted text the maps to the hit.

Highlighted text is automatically cached when using CompassHighlighter using CompassHits.highlighter(int).

Specified by:
getHighlightedText in interface CompassHit
Returns:
The cached highlighted hits
Throws:
CompassException

highlightedText

public CompassHighlightedText highlightedText()
                                       throws CompassException
Description copied from interface: CompassHit
Same as CompassHit.getHighlightedText().

Specified by:
highlightedText in interface CompassHit
Throws:
CompassException

getAlias

public String getAlias()
                throws CompassException
Description copied from interface: CompassHit
Returns the alias value of the hit.

Specified by:
getAlias in interface CompassHit
Returns:
The alias.
Throws:
CompassException

alias

public String alias()
             throws CompassException
Description copied from interface: CompassHit
Same as CompassHit.getAlias().

Specified by:
alias in interface CompassHit
Throws:
CompassException


Copyright (c) 2004-2009 The Compass Project.