com.fatdog.xmlEngine
Class ResultList

java.lang.Object
  extended bycom.fatdog.xmlEngine.ResultList

public class ResultList
extends java.lang.Object

A collection class representing the results of a query. A linked list holds subordinate DocItems objects.

Version:
0.66
Author:
Howard Katz, howardk@fatdog.com

Constructor Summary
ResultList(TreeWalker walker)
           
ResultList(TreeWalker walker, int[] singleValueType)
           
ResultList(TreeWalker walker, int[] singleValueType, int docId)
           
 
Method Summary
 void amalgamateAdjacentAtomics()
           
 void append(ResultList rhs)
           
 void appendDocument(DocItems items)
           
 void appendResults(ResultList addend)
           
 ResultList appendSequence(ResultList rhs)
           
 java.lang.String asString()
           
 java.lang.String asString(boolean appendSpace)
           
 boolean booleanValue()
           
 boolean booleanValue(int[] valueType)
           
 ResultList cloneResultList()
           
 ResultList complexBlockPositional(java.lang.String comparisonOp, int subscript)
           
 ResultList complexPositional(java.lang.String comparisonOp, int subscript)
           
 ResultList contains_word(java.util.Vector words, java.util.Vector flags)
           
 boolean containsAtomics()
           
 boolean containsNonAtomics()
           
 void copyResultItemsToDestination(QueryDocumentTree fromTree, QueryDocumentTree toTree)
           
 java.lang.String debugDump()
           
 boolean effectiveBooleanValue()
           
 void emitAttributes(java.io.PrintWriter w)
           
 java.lang.String emitXml()
           
 java.lang.String emitXml(boolean prettyPrint)
           
 void emitXml(java.io.PrintWriter pw, boolean prettyPrint)
           
 ResultList evalAncestor(ResultList ancestorResults)
           
 ResultList evalAncestor(ResultList ancestorResults, boolean allowSelfMatches)
           
 ResultList evalParent(ResultList parentResults, ResultList childResults, boolean isPredicate)
           
 int evaluateAsInteger()
           
 ResultList generalCompare(java.lang.String op, ResultList lhs, ResultList rhs)
           
 ResultList generalCompareOnLhs(java.lang.String op, ResultList lhs, ResultList rhs)
           
 SimpleNode getAST()
           
 int[] getDocNotatedNodeList()
          amalgamate docId and nodeid info for use by ResultList client (right now, JUnit tester uses to compare result sets
 DocItems getDocumentWithId(int id)
           
 IndexManager getIndexer()
           
 int getItemType(int[] item)
           
 int getItemValue(int[] item)
           
 int getNumDocuments()
           
 int getNumTotalItems()
           
 int getNumValidItems()
           
 boolean getSingleBooleanValue()
           
 java.lang.String getStringResult(int item)
          Given a string ID component from a String item, retrieve the string itself.
 TreeWalker getTreeWalker()
           
 boolean hasUsedContext()
           
 DocItems headDocument()
           
 boolean isAtomic(int[] item)
           
 boolean isAttributeNode(int[] item)
           
 boolean isAttributesOnly()
           
 boolean isBoolean(int[] item)
           
 boolean isBooleanValue(int[] valueType)
           
 boolean isElementNode(int[] item)
           
 boolean isInteger(int[] item)
           
 boolean isNode(int[] item)
           
 boolean isSingleBoolean()
           
 boolean isString(int[] item)
           
 boolean isTextNode(int[] item)
           
 ResultList namedAncestor(java.lang.String ancestor, int nodeType)
           
 ResultList namedChildOfParent(java.lang.String child, int type, boolean isPredicate)
           
 ResultList namedParentOfEvaledChild(java.lang.String namedParent)
           
 ResultList newBoolean(boolean boolValue)
           
 ResultList newDocumentNode(int docId)
           
 ResultList newInteger(int integer)
           
 ResultList newInteger(java.lang.String integer)
           
 ResultList newLeafNodeLists(int nodeType, java.lang.String qName)
           
 ResultList newNamedNodesAtRoot(java.lang.String elementName)
           
 ResultList newNamedParentOfNamedChild(java.lang.String parentName, java.lang.String childName, boolean isAttribute, boolean isPredicate)
           
 ResultList newParentOf(int type, java.lang.String childName)
           
 ResultList newSiblingLists(int siblingType, java.lang.String qName)
           
 ResultList newSiblingLists(int siblingType, java.lang.String qName, int subscript)
           
 ResultList newString(java.lang.String string)
           
 DocItems nextDocument()
           
 ResultList nodesAtRoot()
           
 ResultList parentOf()
           
 ResultList removeAttributes()
           
 void removeDocument(DocItems items)
           
 void replaceDocument(DocItems oldDoc, DocItems newDoc)
           
 void resetDocumentIterator()
           
 void setAST(SimpleNode ast)
           
 void setHasUsedContext(boolean usedIt)
           
 void setNumValidItems(int numValid)
           
 void sort(IntList orderSpecList, IntList returnCounts)
           
 ResultList string_value()
           
 ResultList string_value(boolean addInterTextSpaces)
           
 ResultList subscript(int n)
           
 DocItems tailDocument()
           
 java.lang.String toString()
           
 java.lang.String toString(boolean detailOnly)
           
 void updateTotalItemCount(int update)
           
 void updateValidItemCount(int update)
           
 int[] valueType_0(int n)
           
 int[] valueType(int n)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResultList

public ResultList(TreeWalker walker)

ResultList

public ResultList(TreeWalker walker,
                  int[] singleValueType,
                  int docId)

ResultList

public ResultList(TreeWalker walker,
                  int[] singleValueType)
Method Detail

hasUsedContext

public boolean hasUsedContext()

setHasUsedContext

public void setHasUsedContext(boolean usedIt)

setAST

public void setAST(SimpleNode ast)

getAST

public SimpleNode getAST()

getIndexer

public IndexManager getIndexer()

getTreeWalker

public TreeWalker getTreeWalker()

headDocument

public DocItems headDocument()

tailDocument

public DocItems tailDocument()

getItemValue

public int getItemValue(int[] item)

getItemType

public int getItemType(int[] item)

evaluateAsInteger

public int evaluateAsInteger()

getNumDocuments

public int getNumDocuments()

getNumValidItems

public int getNumValidItems()

setNumValidItems

public void setNumValidItems(int numValid)

getNumTotalItems

public int getNumTotalItems()

updateTotalItemCount

public void updateTotalItemCount(int update)

updateValidItemCount

public void updateValidItemCount(int update)

nextDocument

public DocItems nextDocument()

subscript

public ResultList subscript(int n)

valueType

public int[] valueType(int n)

valueType_0

public int[] valueType_0(int n)

newInteger

public ResultList newInteger(java.lang.String integer)
                      throws InvalidQueryException
Throws:
InvalidQueryException

newInteger

public ResultList newInteger(int integer)

newString

public ResultList newString(java.lang.String string)

newBoolean

public ResultList newBoolean(boolean boolValue)

newDocumentNode

public ResultList newDocumentNode(int docId)

append

public void append(ResultList rhs)

appendSequence

public ResultList appendSequence(ResultList rhs)

removeDocument

public void removeDocument(DocItems items)

appendDocument

public void appendDocument(DocItems items)

getDocNotatedNodeList

public int[] getDocNotatedNodeList()
amalgamate docId and nodeid info for use by ResultList client (right now, JUnit tester uses to compare result sets


newNamedParentOfNamedChild

public ResultList newNamedParentOfNamedChild(java.lang.String parentName,
                                             java.lang.String childName,
                                             boolean isAttribute,
                                             boolean isPredicate)
                                      throws InvalidQueryException
Throws:
InvalidQueryException

newLeafNodeLists

public ResultList newLeafNodeLists(int nodeType,
                                   java.lang.String qName)
                            throws InvalidQueryException
Throws:
InvalidQueryException

newSiblingLists

public ResultList newSiblingLists(int siblingType,
                                  java.lang.String qName)
                           throws InvalidQueryException
Throws:
InvalidQueryException

newSiblingLists

public ResultList newSiblingLists(int siblingType,
                                  java.lang.String qName,
                                  int subscript)
                           throws InvalidQueryException
Throws:
InvalidQueryException

complexPositional

public ResultList complexPositional(java.lang.String comparisonOp,
                                    int subscript)

complexBlockPositional

public ResultList complexBlockPositional(java.lang.String comparisonOp,
                                         int subscript)

newNamedNodesAtRoot

public ResultList newNamedNodesAtRoot(java.lang.String elementName)
                               throws InvalidQueryException
Throws:
InvalidQueryException

parentOf

public ResultList parentOf()

newParentOf

public ResultList newParentOf(int type,
                              java.lang.String childName)
                       throws InvalidQueryException
Throws:
InvalidQueryException

getDocumentWithId

public DocItems getDocumentWithId(int id)

evalAncestor

public ResultList evalAncestor(ResultList ancestorResults)

evalAncestor

public ResultList evalAncestor(ResultList ancestorResults,
                               boolean allowSelfMatches)

namedAncestor

public ResultList namedAncestor(java.lang.String ancestor,
                                int nodeType)
                         throws InvalidQueryException
Throws:
InvalidQueryException

namedParentOfEvaledChild

public ResultList namedParentOfEvaledChild(java.lang.String namedParent)
                                    throws InvalidQueryException
Throws:
InvalidQueryException

asString

public java.lang.String asString()

asString

public java.lang.String asString(boolean appendSpace)

toString

public java.lang.String toString()

toString

public java.lang.String toString(boolean detailOnly)

nodesAtRoot

public ResultList nodesAtRoot()

resetDocumentIterator

public void resetDocumentIterator()

namedChildOfParent

public ResultList namedChildOfParent(java.lang.String child,
                                     int type,
                                     boolean isPredicate)
                              throws InvalidQueryException
Throws:
InvalidQueryException

replaceDocument

public void replaceDocument(DocItems oldDoc,
                            DocItems newDoc)

evalParent

public ResultList evalParent(ResultList parentResults,
                             ResultList childResults,
                             boolean isPredicate)

debugDump

public java.lang.String debugDump()

contains_word

public ResultList contains_word(java.util.Vector words,
                                java.util.Vector flags)
                         throws InvalidQueryException
Throws:
InvalidQueryException

emitXml

public java.lang.String emitXml()

emitXml

public java.lang.String emitXml(boolean prettyPrint)

emitXml

public void emitXml(java.io.PrintWriter pw,
                    boolean prettyPrint)

cloneResultList

public ResultList cloneResultList()

string_value

public ResultList string_value()

string_value

public ResultList string_value(boolean addInterTextSpaces)

getStringResult

public java.lang.String getStringResult(int item)
Given a string ID component from a String item, retrieve the string itself.

Parameters:
item - an integer ID representing a string.
Returns:
the string it stands for.

effectiveBooleanValue

public boolean effectiveBooleanValue()

removeAttributes

public ResultList removeAttributes()

appendResults

public void appendResults(ResultList addend)

containsAtomics

public boolean containsAtomics()

containsNonAtomics

public boolean containsNonAtomics()

sort

public void sort(IntList orderSpecList,
                 IntList returnCounts)
          throws InvalidQueryException
Throws:
InvalidQueryException

generalCompareOnLhs

public ResultList generalCompareOnLhs(java.lang.String op,
                                      ResultList lhs,
                                      ResultList rhs)
                               throws InvalidQueryException
Throws:
InvalidQueryException

generalCompare

public ResultList generalCompare(java.lang.String op,
                                 ResultList lhs,
                                 ResultList rhs)
                          throws InvalidQueryException
Throws:
InvalidQueryException

booleanValue

public boolean booleanValue(int[] valueType)

booleanValue

public boolean booleanValue()

isBooleanValue

public boolean isBooleanValue(int[] valueType)

amalgamateAdjacentAtomics

public void amalgamateAdjacentAtomics()

copyResultItemsToDestination

public void copyResultItemsToDestination(QueryDocumentTree fromTree,
                                         QueryDocumentTree toTree)

isAttributesOnly

public boolean isAttributesOnly()

emitAttributes

public void emitAttributes(java.io.PrintWriter w)

isNode

public boolean isNode(int[] item)

isAtomic

public boolean isAtomic(int[] item)

isInteger

public boolean isInteger(int[] item)

isString

public boolean isString(int[] item)

isBoolean

public boolean isBoolean(int[] item)

isElementNode

public boolean isElementNode(int[] item)

isAttributeNode

public boolean isAttributeNode(int[] item)

isTextNode

public boolean isTextNode(int[] item)

getSingleBooleanValue

public boolean getSingleBooleanValue()
                              throws InvalidQueryException
Throws:
InvalidQueryException

isSingleBoolean

public boolean isSingleBoolean()