org.compass.core
Interface CompassHit

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultCompassHit

public interface CompassHit
extends Serializable

Wrapper that provides a lazily loaded hit from CompassHitsOperations. It is also used as the iterator value for CompassHitIterator.

Author:
kimchy

Method Summary
 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.
 

Method Detail

getAlias

String getAlias()
                throws CompassException
Returns the alias value of the hit.

Returns:
The alias.
Throws:
CompassException

getData

Object getData()
               throws CompassException
Returns the object for this hit.

Returns:
The object data of the hit.
Throws:
CompassException
See Also:
CompassHitsOperations.data(int)

getResource

Resource getResource()
                     throws CompassException
Returns the Resource for this hit.

Returns:
The Resource of the hit.
Throws:
CompassException
See Also:
CompassHitsOperations.resource(int)

getScore

float getScore()
               throws CompassException
Returns the score for this hit.

Returns:
The score of the hit.
Throws:
CompassException
See Also:
CompassHitsOperations.score(int)

getHighlightedText

CompassHighlightedText getHighlightedText()
                                          throws CompassException
Returns a cached highlighted text the maps to the hit.

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

Returns:
The cached highlighted hits
Throws:
CompassException


Copyright (c) 2004-2006 The Compass Project.