com.rapidtransform.core.search.lucene
Class SearchResultsCompass.Page

java.lang.Object
  extended by com.rapidtransform.core.search.lucene.SearchResultsCompass.Page
Enclosing class:
SearchResultsCompass

public static class SearchResultsCompass.Page
extends java.lang.Object

SearchResultsCompass internal class used for pagination. For each page, this class holds the page's from index and number of results (size) for the page. It also includes a flag indicating if this is the currently selected page. A Page can cache it's hits by setting it's internal hits array. This will improve performance since the search engine will not be required to re-execute the query for each page.


Constructor Summary
SearchResultsCompass.Page()
          Default constructor
SearchResultsCompass.Page(org.compass.core.CompassHits[] hits)
          Constructor used to create a page with it's hits cached internally.
 
Method Summary
 int getFrom()
           
 org.compass.core.CompassHits[] getHits()
          Returns the cached hits for this page or null if no hits are loaded.
 int getSize()
           
 boolean isLoaded()
          Used to check the loaded status of hits cached in this page.
 boolean isSelected()
           
 void setFrom(int from)
           
 void setHits(org.compass.core.CompassHits[] hits)
          Set the Hits for this page.
 void setSelected(boolean selected)
           
 void setSize(int size)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchResultsCompass.Page

public SearchResultsCompass.Page()
Default constructor


SearchResultsCompass.Page

public SearchResultsCompass.Page(org.compass.core.CompassHits[] hits)
Constructor used to create a page with it's hits cached internally.

Parameters:
hits -
Method Detail

getFrom

public int getFrom()
Returns:
Returns the from.

setFrom

public void setFrom(int from)
Parameters:
from - The from to set.

isSelected

public boolean isSelected()
Returns:
Returns the selected.

setSelected

public void setSelected(boolean selected)
Parameters:
selected - The selected to set.

getSize

public int getSize()
Returns:
Returns the size.

setSize

public void setSize(int size)
Parameters:
size - The size to set.

isLoaded

public boolean isLoaded()
Used to check the loaded status of hits cached in this page.

Returns:
Returns whether or not this Page has it's hits loaded.

getHits

public org.compass.core.CompassHits[] getHits()
Returns the cached hits for this page or null if no hits are loaded. Check loaded flag to determine loaded status.

Returns:
Returns the hits.

setHits

public void setHits(org.compass.core.CompassHits[] hits)
Set the Hits for this page. These hits act as a cache for pagination so the search engine doesn't have to re-execute the query for each page.

Parameters:
hits - The hits to set.