com.raritantechnologies.searchApp.browse
Class InMemoryBrowse

java.lang.Object
  extended bycom.raritantechnologies.searchApp.browse.Browse
      extended bycom.raritantechnologies.searchApp.browse.InMemoryBrowse
All Implemented Interfaces:
IBrowse, IBrowseDirectoryEntry, IBrowseListWriter, IConfigurable, IResultSetProcessor

public class InMemoryBrowse
extends Browse
implements IBrowseDirectoryEntry, IResultSetProcessor, IBrowseListWriter

Builds an Browse List "on the fly" from a set of results.


Field Summary
 
Fields inherited from class com.raritantechnologies.searchApp.browse.Browse
cachedPages
 
Constructor Summary
InMemoryBrowse()
           
 
Method Summary
 void addBrowseItem(java.lang.String fieldName, java.lang.String browseTerm, java.lang.String displayTerm, java.lang.String searchSource, int counts, int page)
           
protected  int addPageToCache(int page, int index)
          Adds a "page" worth of filtered data and returns the actual count of rows added to the cache
 void dataComplete()
          Data feed is complete.
 java.util.Map getBrowseCounts(java.lang.String fieldName)
          Returns a map of searchSource --> map of term --> counts for fieldName
 int getMaxPage()
          Get the maximum page number for the field's browse list
 int getMinPage()
          Get the minimum page number for the field's browse list
 int getPageNumber(java.lang.String term)
          this function figures out which page the search term should be in
 void initialize()
           
 void initialize(java.util.Map initParams)
          Dynamic initialization.
 boolean isRefreshRequired()
          Use this method to see if the master list has been updated.
 boolean isValid()
           
 void processResultSet(java.lang.String sessionID, IResultSet data)
          processes the IResultSet (somehow)
 void saveBrowseList()
           
 void setResultField(java.lang.String resultField)
           
 
Methods inherited from class com.raritantechnologies.searchApp.browse.Browse
getBrowseDirectory, getCurrentPage, getFirstPage, getFirstPage, getNextPage, getPrevPage, initialize, initialize, isFirstPage, isLastPage, setBrowseDirectory, setBrowseHitPosition, setBrowsePageSize, setExcludes, setIncludes, wasTermFound
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.raritantechnologies.searchApp.browse.IBrowseDirectoryEntry
initialize, initialize
 
Methods inherited from interface com.raritantechnologies.searchApp.IResultSetProcessor
initialize
 

Constructor Detail

InMemoryBrowse

public InMemoryBrowse()
Method Detail

setResultField

public void setResultField(java.lang.String resultField)

initialize

public void initialize()

processResultSet

public void processResultSet(java.lang.String sessionID,
                             IResultSet data)
Description copied from interface: IResultSetProcessor
processes the IResultSet (somehow)

Specified by:
processResultSet in interface IResultSetProcessor

dataComplete

public void dataComplete()
Data feed is complete.

Specified by:
dataComplete in interface IResultSetProcessor

addBrowseItem

public void addBrowseItem(java.lang.String fieldName,
                          java.lang.String browseTerm,
                          java.lang.String displayTerm,
                          java.lang.String searchSource,
                          int counts,
                          int page)
Specified by:
addBrowseItem in interface IBrowseListWriter

saveBrowseList

public void saveBrowseList()
Specified by:
saveBrowseList in interface IBrowseListWriter

addPageToCache

protected int addPageToCache(int page,
                             int index)
Description copied from class: Browse
Adds a "page" worth of filtered data and returns the actual count of rows added to the cache

Overrides:
addPageToCache in class Browse

getBrowseCounts

public java.util.Map getBrowseCounts(java.lang.String fieldName)
Description copied from interface: IBrowseListWriter
Returns a map of searchSource --> map of term --> counts for fieldName

Specified by:
getBrowseCounts in interface IBrowseListWriter

initialize

public void initialize(java.util.Map initParams)
Dynamic initialization.

Specified by:
initialize in interface IResultSetProcessor

isRefreshRequired

public boolean isRefreshRequired()
Use this method to see if the master list has been updated.

Specified by:
isRefreshRequired in interface IBrowseDirectoryEntry

getPageNumber

public int getPageNumber(java.lang.String term)
this function figures out which page the search term should be in

Specified by:
getPageNumber in interface IBrowseDirectoryEntry

getMaxPage

public int getMaxPage()
Get the maximum page number for the field's browse list

Specified by:
getMaxPage in interface IBrowseDirectoryEntry

getMinPage

public int getMinPage()
Get the minimum page number for the field's browse list

Specified by:
getMinPage in interface IBrowseDirectoryEntry

isValid

public boolean isValid()
Specified by:
isValid in interface IBrowseDirectoryEntry