com.raritantechnologies.xml
Class XMLResultDispatchCollector

java.lang.Object
  extended bycom.raritantechnologies.xml.sax.filter.ElementDispatcher
      extended bycom.raritantechnologies.xml.XMLResultDispatchCollector
All Implemented Interfaces:
IResultSet

public class XMLResultDispatchCollector
extends ElementDispatcher
implements IResultSet

Collects XMLResults that are dispatched by the DispatchFilter into an ArrayList.

XMLResult is initialized by a ProgrammableSAXFilter.

Constructor takes a list of CallbackOperation objects used to set up the ProgrammableSAXFilter.


Developed by Raritan Technologies .

Author:
Ted Sullivan

Field Summary
 
Fields inherited from interface com.raritantechnologies.searchApp.IResultSet
ELAPSEDTIME, PAGESIZE, QUERYSTRING, RESULTSETID, STARTDOC, TOTALDOCS
 
Constructor Summary
XMLResultDispatchCollector()
           
XMLResultDispatchCollector(ElementSelector selector, java.util.List callbackList, java.lang.String rootTagName)
           
XMLResultDispatchCollector(ElementSelector selector, java.util.List callbackList, java.lang.String rootTagName, IResultSet resSetProxy)
           
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.Object attr)
           
 void addResult(IResult result)
           
 void dispatchEnding()
          dispatch event ended.
 void dispatchStarting()
          Dispatch event is starting.
 java.lang.Object getAttribute(java.lang.String name)
           
 java.util.Iterator getAttributes()
          ResultSet Properties
 org.xml.sax.ContentHandler getContentHandler()
          Returns the ProgrammableSAXFilter set up to initialize the XMLResult
 double getElapsedTime()
           
 long getElapsedTimeMS()
           
 int getEndDoc()
           
 INavigator getNavigator()
          To Support Faceted Navigation
 int getPageSize()
           
 java.lang.String getQueryString()
           
 IResult getResult(int index)
           
 java.util.Iterator getResults()
           
 java.util.Iterator getResults(ISorter sortBy)
           
 java.lang.Integer getResultSetID()
           
 int getStartDoc()
           
 int getTotalDocs()
           
 java.lang.String getXML()
           
 java.lang.String getXML(ISorter sortBy)
           
 java.lang.String getXML(java.util.Iterator headerFields, java.util.Iterator resultFields, java.util.Iterator nestedFields)
           
 void setCallbacks()
           
 void setElapsedTimeMS(long time)
           
 void setNavigator(INavigator navigator)
           
 void setPageSize(int pageSize)
           
 void setQueryString(java.lang.String queryString)
           
 void setResultSetID(java.lang.Integer resultSetID)
           
 void setStartDoc(int startDoc)
           
 void setTotalDocs(int totalDocs)
           
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class com.raritantechnologies.xml.sax.filter.ElementDispatcher
getSelector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLResultDispatchCollector

public XMLResultDispatchCollector()

XMLResultDispatchCollector

public XMLResultDispatchCollector(ElementSelector selector,
                                  java.util.List callbackList,
                                  java.lang.String rootTagName)

XMLResultDispatchCollector

public XMLResultDispatchCollector(ElementSelector selector,
                                  java.util.List callbackList,
                                  java.lang.String rootTagName,
                                  IResultSet resSetProxy)
Method Detail

dispatchStarting

public void dispatchStarting()
Dispatch event is starting. Create a new XMLResult to be initialized by the ProgrammableSAXFilter

Overrides:
dispatchStarting in class ElementDispatcher

getContentHandler

public org.xml.sax.ContentHandler getContentHandler()
Returns the ProgrammableSAXFilter set up to initialize the XMLResult

Overrides:
getContentHandler in class ElementDispatcher

dispatchEnding

public void dispatchEnding()
dispatch event ended. Do post processing.

Overrides:
dispatchEnding in class ElementDispatcher

setCallbacks

public void setCallbacks()

setResultSetID

public void setResultSetID(java.lang.Integer resultSetID)
Specified by:
setResultSetID in interface IResultSet

getResultSetID

public java.lang.Integer getResultSetID()
Specified by:
getResultSetID in interface IResultSet

setQueryString

public void setQueryString(java.lang.String queryString)
Specified by:
setQueryString in interface IResultSet

getQueryString

public java.lang.String getQueryString()
Specified by:
getQueryString in interface IResultSet

setTotalDocs

public void setTotalDocs(int totalDocs)
Specified by:
setTotalDocs in interface IResultSet

getTotalDocs

public int getTotalDocs()
Specified by:
getTotalDocs in interface IResultSet

setStartDoc

public void setStartDoc(int startDoc)
Specified by:
setStartDoc in interface IResultSet

getStartDoc

public int getStartDoc()
Specified by:
getStartDoc in interface IResultSet

setPageSize

public void setPageSize(int pageSize)
Specified by:
setPageSize in interface IResultSet

getPageSize

public int getPageSize()
Specified by:
getPageSize in interface IResultSet

getEndDoc

public int getEndDoc()
Specified by:
getEndDoc in interface IResultSet

addResult

public void addResult(IResult result)
Specified by:
addResult in interface IResultSet

getResults

public java.util.Iterator getResults()
Specified by:
getResults in interface IResultSet

getResults

public java.util.Iterator getResults(ISorter sortBy)
Specified by:
getResults in interface IResultSet

size

public int size()
Specified by:
size in interface IResultSet

getResult

public IResult getResult(int index)
Specified by:
getResult in interface IResultSet

getXML

public java.lang.String getXML()
Specified by:
getXML in interface IResultSet

getXML

public java.lang.String getXML(ISorter sortBy)
Specified by:
getXML in interface IResultSet

getXML

public java.lang.String getXML(java.util.Iterator headerFields,
                               java.util.Iterator resultFields,
                               java.util.Iterator nestedFields)
Specified by:
getXML in interface IResultSet

toString

public java.lang.String toString()
Specified by:
toString in interface IResultSet

setElapsedTimeMS

public void setElapsedTimeMS(long time)
Specified by:
setElapsedTimeMS in interface IResultSet

getElapsedTimeMS

public long getElapsedTimeMS()
Specified by:
getElapsedTimeMS in interface IResultSet

getElapsedTime

public double getElapsedTime()
Specified by:
getElapsedTime in interface IResultSet

getAttributes

public java.util.Iterator getAttributes()
Description copied from interface: IResultSet
ResultSet Properties

Specified by:
getAttributes in interface IResultSet

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.Object attr)
Specified by:
addAttribute in interface IResultSet

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Specified by:
getAttribute in interface IResultSet

setNavigator

public void setNavigator(INavigator navigator)
Specified by:
setNavigator in interface IResultSet

getNavigator

public INavigator getNavigator()
Description copied from interface: IResultSet
To Support Faceted Navigation

Specified by:
getNavigator in interface IResultSet