org.activemath.webapp.dict.queries
Class SearchResultCursor
java.lang.Object
org.activemath.webapp.dict.queries.SearchResultCursor
public class SearchResultCursor
- extends Object
Simple set of properties of a search-result
current cursor.
DEFAULT_PAGE_LENGTH
public static final int DEFAULT_PAGE_LENGTH
- See Also:
- Constant Field Values
SearchResultCursor
public SearchResultCursor(AMQueryPack queryPack)
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-policyapplyLearnerSymbolPolicy - 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)