cz.cuni.versatile.api
Interface ResourceEntry

All Known Subinterfaces:
ResultSet

public interface ResourceEntry

ResourceEntry represents an element of the N-best result list produced by a ResourceProvider in a response to a particular Query. The ResourceEntry object contains not only the resource itself but also its meta-data annotations (property/value pairs). The ability to provide resources alongside their meta-data is especially important when using constraint-relaxing (fall-back) types of searches, when the results returned may only approximate the Query.

Author:
Jaroslav Gergic

Method Summary
 int getIndex()
          The zero-based index of this resource entry in the parent ResultSet.
 java.util.Map getProperties()
          Return the meta-data annotations of the resource (property/value pairs).
 ResultSet getResultSet()
          Returns the parent ResultSet of this ResourceEntry.
 double getScore()
          Return the relative quality score of this resource entry with the respect to the Query.
 java.lang.Object getValue()
          Returns the actual resource (the value of the ResourceEntry).
 

Method Detail

getResultSet

public ResultSet getResultSet()
Returns the parent ResultSet of this ResourceEntry.

Returns:
the parent ResultSet of this ResourceEntry

getValue

public java.lang.Object getValue()
Returns the actual resource (the value of the ResourceEntry).

Returns:
the actual resource (the value of the ResourceEntry).

getProperties

public java.util.Map getProperties()
Return the meta-data annotations of the resource (property/value pairs). The keys of the map are Property instances, the values of the map are the property values assigned as meta-data annotations to the resource represented by this entry.

Returns:
the meta-data annotations of the resource (property/value pairs).

getScore

public double getScore()
Return the relative quality score of this resource entry with the respect to the Query. The number must be from the interval (Query#DEFAULT_MATCH_SCORE, Query#EXACT_MATCH_SCORE> which corresponds to (0.0, 1.0>.

Returns:
the quality score of this resource entry.
See Also:
Query

getIndex

public int getIndex()
The zero-based index of this resource entry in the parent ResultSet.

Returns:
zero-based index of this resource entry in the parent ResultSet.