org.egothor.cache
Class CachedQuery

java.lang.Object
  extended by org.egothor.cache.CachedQuery

public class CachedQuery
extends java.lang.Object

Represents a complete information about a submitted query that can be used as a key from Cache objects.


Constructor Summary
CachedQuery(Query query, Token[] tokens, int offset, int length, long max_hits2scan, double pg_rerank)
          Constructor for the CachedQuery object.
 
Method Summary
 boolean equals(java.lang.Object o)
          Checks whether the specified object is equal to this one.
 int getLength()
          Returns the maximum length of the result set.
 long getMaxHitsToScan()
          Returns maximum number of hits that were scanned.
 int getOffset()
          Returns the index of the first requested result.
 double getPageReRank()
          Return the value of the page rerank.
 Query getQuery()
          Gets the query which results we are caching.
 Token[] getTokens()
          Gets the tokens that are forming the query
 int hashCode()
          Returns a hash code value for the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedQuery

public CachedQuery(Query query,
                   Token[] tokens,
                   int offset,
                   int length,
                   long max_hits2scan,
                   double pg_rerank)
Constructor for the CachedQuery object.

Parameters:
query - parsed query submitted
tokens - actual tokens submitted
offset - index of the first result to return
length - maximum number of results to return
max_hits2scan - maximum number of positive hits to scan
pg_rerank - value of the page rerank
Method Detail

getQuery

public Query getQuery()
Gets the query which results we are caching.

Returns:
query which results we are caching

getTokens

public Token[] getTokens()
Gets the tokens that are forming the query

Returns:
array of tokens forming the query.

getOffset

public int getOffset()
Returns the index of the first requested result.

Returns:
index of the first requested result

getLength

public int getLength()
Returns the maximum length of the result set.

Returns:
maximum length of the result set

getMaxHitsToScan

public long getMaxHitsToScan()
Returns maximum number of hits that were scanned.

Returns:
maximum number of hits that were scanned

getPageReRank

public double getPageReRank()
Return the value of the page rerank.

Returns:
page rerank

equals

public boolean equals(java.lang.Object o)
Checks whether the specified object is equal to this one.

Overrides:
equals in class java.lang.Object
Returns:
true if this object is the same as the argument; false otherwise

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class java.lang.Object
Returns:
hash code value for this object