edu.ucsb.nceas.morpho.query
Class ResultSet

edu.ucsb.nceas.morpho.query.ResultSet
Direct Known Subclasses:
HeadResultSet

public class ResultSet

A ResultSet encapsulates the list of results returned from either a local query or a Metacat query. It contains a reference to its original query, so the result set can be refreshed by re-running the query. Current MetaCat query returns a element for each 'hit' in query. That element has 5 fixed children: , , , , and . Other child elements are determined by query and are returned as elements with a "name" attribute and the value as the content.


Field Summary
protected  java.util.Vector resultsVector
          Store each row of the result set as a row in a Vector
 
Constructor Summary
ResultSet(Query query, java.lang.String source, java.io.InputStream resultsXMLStream, ClientFramework cf)
          Construct a ResultSet instance given a query object and a InputStream that represents an XML encoding of the results.
ResultSet(Query query, java.lang.String source, java.util.Vector vec, ClientFramework cf)
          Construct a ResultSet instance from a vector of vectors; for use with LocalQuery
 
Method Summary
 void characters(char[] ch, int start, int length)
          SAX handler callback that is called for character content of an element when parsing an XML document.
 void endDocument()
          Unused SAX handler
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          SAX handler callback that is called upon the end of an element when parsing an XML document.
 void endPrefixMapping(java.lang.String prefix)
          Unused SAX handler
 java.lang.Class getColumnClass(int c)
          Return the Class for each column so that they can be rendered correctly.
 int getColumnCount()
          Return the number of columns in this result set
 java.lang.String getColumnName(int col)
          Determine the name of a column by its index
 ClientFramework getFramework()
          Get a reference to the framework
 Query getQuery()
          Get the query that was used to construct these results
 java.util.Vector getResultsVector()
          get the resultsVector
 int getRowCount()
          Return the number of records in this result set
 int getRowHeight()
          Return the correct row height for table rows
 java.lang.Object getValueAt(int row, int col)
          Determine the value of a column by its row and column index
 void ignorableWhitespace(char[] cbuf, int start, int len)
          Unused SAX handler
 void merge(ResultSet r2)
          Merge a ResultSet onto this one using the docid as the join column
 void openResultRecord(int row)
          Open a given row index of the result set using a delegated handler class
protected  void openResultRecord(java.util.Vector rowVector)
          Open a given row of the result set using a delegated handler class
 void processingInstruction(java.lang.String target, java.lang.String data)
          Unused SAX handler
 void setDocumentLocator(org.xml.sax.Locator locator)
          Unused SAX handler
 void setQuery(Query query)
          Set the query that was used to construct these results (for use by LocalQuery)
 void setResultsVector(java.util.Vector rv)
          set the resultsVector
 void skippedEntity(java.lang.String name)
          Unused SAX handler
 void startDocument()
          SAX handler callback that is called when an XML document is initially parsed.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          SAX handler callback that is called upon the start of an element when parsing an XML document.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Unused SAX handler
 

Field Detail

resultsVector

protected java.util.Vector resultsVector
Store each row of the result set as a row in a Vector
Constructor Detail

ResultSet

public ResultSet(Query query,
                 java.lang.String source,
                 java.io.InputStream resultsXMLStream,
                 ClientFramework cf)
Construct a ResultSet instance given a query object and a InputStream that represents an XML encoding of the results.

ResultSet

public ResultSet(Query query,
                 java.lang.String source,
                 java.util.Vector vec,
                 ClientFramework cf)
Construct a ResultSet instance from a vector of vectors; for use with LocalQuery
Method Detail

getResultsVector

public java.util.Vector getResultsVector()
get the resultsVector

setResultsVector

public void setResultsVector(java.util.Vector rv)
set the resultsVector

getColumnCount

public int getColumnCount()
Return the number of columns in this result set

getRowCount

public int getRowCount()
Return the number of records in this result set

getRowHeight

public int getRowHeight()
Return the correct row height for table rows

getColumnName

public java.lang.String getColumnName(int col)
Determine the name of a column by its index

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Determine the value of a column by its row and column index

getColumnClass

public java.lang.Class getColumnClass(int c)
Return the Class for each column so that they can be rendered correctly.

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
SAX handler callback that is called upon the start of an element when parsing an XML document.

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
SAX handler callback that is called upon the end of an element when parsing an XML document.

characters

public void characters(char[] ch,
                       int start,
                       int length)
SAX handler callback that is called for character content of an element when parsing an XML document.

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
SAX handler callback that is called when an XML document is initially parsed.

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Unused SAX handler

ignorableWhitespace

public void ignorableWhitespace(char[] cbuf,
                                int start,
                                int len)
Unused SAX handler

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
Unused SAX handler

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Unused SAX handler

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Unused SAX handler

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
Unused SAX handler

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Unused SAX handler

getQuery

public Query getQuery()
Get the query that was used to construct these results

setQuery

public void setQuery(Query query)
Set the query that was used to construct these results (for use by LocalQuery)

openResultRecord

public void openResultRecord(int row)
Open a given row index of the result set using a delegated handler class

openResultRecord

protected void openResultRecord(java.util.Vector rowVector)
Open a given row of the result set using a delegated handler class

merge

public void merge(ResultSet r2)
Merge a ResultSet onto this one using the docid as the join column

getFramework

public ClientFramework getFramework()
Get a reference to the framework


Copyright © 2000 National Center for Ecological Analysis and Synthesis. All Rights Reserved.