gov.nist.nlpir.irf.result
Class ResultForDocMatchingQuery

java.lang.Object
  |
  +--gov.nist.nlpir.irf.result.ResultForDocMatchingQuery

public class ResultForDocMatchingQuery
extends java.lang.Object
implements java.util.Comparator

The result of a search modelling the match between a document and a query - at the level of a single document and all the information needed to calculate the RSV for the document.

Version:
$Revision: 1.2 $
Author:
This software was produced by NIST, an agency of the U.S. government, and by statute is not subject to copyright in the United States. Recipients of this software assume all responsibilities associated with its operation, modification and maintenance.

Field Summary
private  ProxyDocument doc
          The document for which this result comprises the evidence
private  java.util.Vector partialResults
          The lower-level results - these are per-field/index.
private  QueryRep query
          The query associated with this result
private  double RSV
          The retrieval status value for this result
 
Constructor Summary
ResultForDocMatchingQuery()
          Creates an empty ResultForDocMatchingQuery
ResultForDocMatchingQuery(QueryRep q, ProxyDocument d, java.util.Vector results)
          Creates a ResultForDocMatchingQuery for the supplied query, doc and results.
 
Method Summary
 void addPartialResult(ResultForDocMatchingQueryModalityUnit aPR)
          Adds ResultForDocMatchingQueryModalityUnit to the partialResults.
 double calcRSV(QueryRep aQueryRep)
          Calculates the final Retrieval Status Value for a document by combining the scores obtained for each term in the query across all indexes.
 int compare(java.lang.Object o2)
          Compares two results in terms of Retrival Status Value
 int compare(java.lang.Object o1, java.lang.Object o2)
          Compares two results in terms of Retrival Status Value NOTE: This compare reverses the standard sort sequence so that index 1 of the list contains the highest RSV
 ProxyDocument getDocument()
          Returns the document this result refers to.
 java.util.Vector getIndexingFeatures()
          Gets results for these indexing features
 java.util.Vector getPartialResults()
          Returns the partialResults this result is a part of.
 QueryRep getQuery()
          Returns the query
 double getRSV()
          Gets the Retrieval Status Value (RSV).
 void present()
          Displays information about this result
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

query

private QueryRep query
The query associated with this result

RSV

private double RSV
The retrieval status value for this result

doc

private ProxyDocument doc
The document for which this result comprises the evidence

partialResults

private java.util.Vector partialResults
The lower-level results - these are per-field/index. Consists of ResultForDocMatchingQueryModalityUnit elements
Constructor Detail

ResultForDocMatchingQuery

public ResultForDocMatchingQuery()
Creates an empty ResultForDocMatchingQuery

ResultForDocMatchingQuery

public ResultForDocMatchingQuery(QueryRep q,
                                 ProxyDocument d,
                                 java.util.Vector results)
Creates a ResultForDocMatchingQuery for the supplied query, doc and results. The RSV is initialized to 0.0.
Parameters:
q - A query.
d - An Document
results - Partial results (Vector of ResultForDocMatchingQueryModalityUnits)
Method Detail

getDocument

public ProxyDocument getDocument()
Returns the document this result refers to.
Returns:
the document.

getPartialResults

public java.util.Vector getPartialResults()
Returns the partialResults this result is a part of.
Returns:
The partial results.

getRSV

public double getRSV()
Gets the Retrieval Status Value (RSV).
Returns:
RSV

calcRSV

public double calcRSV(QueryRep aQueryRep)
Calculates the final Retrieval Status Value for a document by combining the scores obtained for each term in the query across all indexes.
Returns:
RSV - Retrieval Status Value

addPartialResult

public void addPartialResult(ResultForDocMatchingQueryModalityUnit aPR)
Adds ResultForDocMatchingQueryModalityUnit to the partialResults.
Parameters:
aPR - Result for doc matching query modality unit.

compare

public int compare(java.lang.Object o2)
Compares two results in terms of Retrival Status Value
Parameters:
o2 - another result of this type
Returns:
1 if this' results' RSV is smaller than o2's,
-1 if it is greater
and 0 if they are equal.

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Compares two results in terms of Retrival Status Value NOTE: This compare reverses the standard sort sequence so that index 1 of the list contains the highest RSV
Specified by:
compare in interface java.util.Comparator
Parameters:
o1 - a result of this type
o2 - another result of this type
Returns:
1 if o1's RSV < o2's RSV
-1 if o1's RSV > o2's RSV
0 if o1's RSV = o2's RSV

getIndexingFeatures

public java.util.Vector getIndexingFeatures()
Gets results for these indexing features
Returns:
a vector of indexing features

getQuery

public QueryRep getQuery()
Returns the query
Returns:
the query

present

public void present()
Displays information about this result