org.activemath.webapp.dict.queries
Class SearchResultCursor

java.lang.Object
  extended by org.activemath.webapp.dict.queries.SearchResultCursor

public class SearchResultCursor
extends Object

Simple set of properties of a search-result current cursor.


Field Summary
static int DEFAULT_PAGE_LENGTH
           
 
Constructor Summary
SearchResultCursor(AMQueryPack queryPack)
           
 
Method Summary
 Object clone()
          Duplicates this object except its result-list.
 Iterator getAccessiblePageNumbers(int numPresented)
          Constructs an iterator which computes a few resultsFrom from the results
 int getCurrentPage()
           
 boolean getEmpty()
           
 Iterator getHitsIterator()
           
 AMQueryPack getQuery()
           
 int getResultsFrom()
           
 int getResultsTo()
           
 int getTotalNumHits()
           
 int getTotalPages()
           
 void gotoNextPage()
           
 void gotoPreviousPage()
           
 void grabHits(SearchResultHits hits, AMIndexSearcher searcher, MBaseRef mbaseRef, boolean applyLearnerSymbolPolicy, List learningContexts)
          Goes through the hits and grabs the ones that'll be kept.
 boolean hasNextPage()
           
 boolean hasPreviousPage()
           
 boolean isEmpty()
           
 void moveTo(int newResultsFrom)
           
 boolean needsPopulation()
           
 void setQuery(AMQueryPack queryPack)
           
 void setResultsFrom(int resultsFrom)
           
 void setResultsTo(int resultsTo)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_PAGE_LENGTH

public static final int DEFAULT_PAGE_LENGTH
See Also:
Constant Field Values
Constructor Detail

SearchResultCursor

public SearchResultCursor(AMQueryPack queryPack)
Method Detail

getResultsTo

public int getResultsTo()

setResultsTo

public void setResultsTo(int resultsTo)

getResultsFrom

public int getResultsFrom()

setResultsFrom

public void setResultsFrom(int resultsFrom)

getQuery

public AMQueryPack getQuery()

setQuery

public void setQuery(AMQueryPack queryPack)

getTotalNumHits

public int getTotalNumHits()

hasNextPage

public boolean hasNextPage()

hasPreviousPage

public boolean hasPreviousPage()

getTotalPages

public int getTotalPages()

getCurrentPage

public int getCurrentPage()

getAccessiblePageNumbers

public Iterator getAccessiblePageNumbers(int numPresented)
Constructs an iterator which computes a few resultsFrom from the results

Parameters:
numPresented -
Returns:

getEmpty

public boolean getEmpty()

isEmpty

public boolean isEmpty()

needsPopulation

public boolean needsPopulation()

getHitsIterator

public Iterator getHitsIterator()

clone

public Object clone()
Duplicates this object except its result-list.

Overrides:
clone in class Object
Returns:
the duplicated object.

grabHits

public void grabHits(SearchResultHits hits,
                     AMIndexSearcher searcher,
                     MBaseRef mbaseRef,
                     boolean applyLearnerSymbolPolicy,
                     List learningContexts)
              throws MBaseException
Goes through the hits and grabs the ones that'll be kept.

Parameters:
hits - lucene-hits out of which one will obtain IDs, score etc...
mbaseRef - used to apply the learner-symbol-policy
applyLearnerSymbolPolicy - wether to apply it or not, this policy states that no symbols should be presented to a learner but, instead, only its definitions, sorted by learning-context
Throws:
MBaseException

gotoNextPage

public void gotoNextPage()

gotoPreviousPage

public void gotoPreviousPage()

moveTo

public void moveTo(int newResultsFrom)