Class XNodeSet
java.lang.Object
org.loboevolution.apache.xpath.Expression
org.loboevolution.apache.xpath.objects.XObject
org.loboevolution.apache.xpath.axes.NodeSequence
org.loboevolution.apache.xpath.objects.XNodeSet
- All Implemented Interfaces:
Cloneable,SourceLocator,DTMIterator,PathComponent,ExpressionNode,XPathVisitable
This class represents an XPath nodeset object, and is capable of converting the nodeset to other
types, such as a string.
-
Field Summary
Fields inherited from class org.loboevolution.apache.xpath.axes.NodeSequence
m_dtmMgr, m_iter, m_last, m_nextFields inherited from class org.loboevolution.apache.xpath.objects.XObject
CLASS_BOOLEAN, CLASS_NODESET, CLASS_NULL, CLASS_NUMBER, CLASS_RTREEFRAG, CLASS_STRING, CLASS_UNKNOWN, m_objFields inherited from interface org.loboevolution.apache.xml.dtm.DTMIterator
FILTER_ACCEPT, FILTER_SKIP -
Constructor Summary
ConstructorsConstructorDescriptionXNodeSet(int n, DTMManager dtmMgr) Construct a XNodeSet object for one node.XNodeSet(DTMIterator val) Construct a XNodeSet object.XNodeSet(DTMManager dtmMgr) Construct an empty XNodeSet object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbool()Cast result object to a boolean.booleanCast result object to a boolean, but allow side effects, such as the incrementing of an iterator.booleanTell if one object is less than the other.booleanTell if two objects are functionally equal.doublegetNumberFromNode(int n) Get numeric value of the string conversion from a single node.getStringFromNode(int n) Get the string conversion from a single node.intgetType()Tell what kind of class this is.Given a request type, return the equivalent string.booleangreaterThan(XObject obj2) Tell if one object is greater than the other.booleangreaterThanOrEqual(XObject obj2) Tell if one object is greater than or equal to the other.iter()Cast result object to a nodelist.iterRaw()Return the iterator without cloning, etc.booleanTell if one object is less than the other.booleanlessThanOrEqual(XObject obj2) Tell if one object is less than or equal to the other.Cast result object to a nodelist.nodelist()Cast result object to a nodelist.nodeset()Cast result object to a nodelist.booleanTell if two objects are functionally not equal.doublenum()Cast result object to a number.doubleCast result object to a number, but allow side effects, such as the incrementing of an iterator.object()Return a java object that's closest to the representation that should be handed to an extension.str()Cast result object to a string.xstr()Cast result object to a string.Methods inherited from class org.loboevolution.apache.xpath.axes.NodeSequence
addNodeInDocOrder, allowDetachToRelease, clone, cloneWithReset, detach, getAnalysisBits, getAxis, getCurrentNode, getCurrentPos, getDTM, getDTMManager, getExpandEntityReferences, getIteratorCache, getLength, getRoot, getVector, getWhatToShow, hasCache, isDocOrdered, isFresh, item, nextNode, previousNode, reset, runTo, setCurrentPos, setIter, setObject, setRoot, setShouldCacheNodes, SetVectorMethods inherited from class org.loboevolution.apache.xpath.objects.XObject
callVisitors, deepEquals, error, error, execute, toStringMethods inherited from class org.loboevolution.apache.xpath.Expression
asIterator, asNode, assertion, bool, canTraverseOutsideSubtree, error, execute, execute, execute, exprGetParent, exprSetParent, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isSameClass, isStableNumber, num
-
Constructor Details
-
XNodeSet
Construct a XNodeSet object.- Parameters:
val- Value of the XNodeSet object
-
XNodeSet
Construct an empty XNodeSet object. This is used to create a mutable nodeset to which random nodes may be added. -
XNodeSet
Construct a XNodeSet object for one node.- Parameters:
n- Node to add to the new XNodeSet object
-
-
Method Details
-
getType
public int getType()Tell what kind of class this is. -
getTypeString
Given a request type, return the equivalent string. For diagnostic purposes.- Overrides:
getTypeStringin classXObject- Returns:
- type string "#UNKNOWN" + object class name
-
getNumberFromNode
public double getNumberFromNode(int n) Get numeric value of the string conversion from a single node.- Parameters:
n- Node to convert- Returns:
- numeric value of the string conversion from a single node.
-
num
public double num()Cast result object to a number. Always issues an error. -
numWithSideEffects
public double numWithSideEffects()Cast result object to a number, but allow side effects, such as the incrementing of an iterator.- Overrides:
numWithSideEffectsin classXObject- Returns:
- numeric value of the string conversion from the next node in the NodeSetDTM, or NAN if no node was found
-
bool
public boolean bool()Cast result object to a boolean. Always issues an error. -
boolWithSideEffects
public boolean boolWithSideEffects()Cast result object to a boolean, but allow side effects, such as the incrementing of an iterator.- Overrides:
boolWithSideEffectsin classXObject- Returns:
- True if there is a next node in the nodeset
-
getStringFromNode
Get the string conversion from a single node.- Parameters:
n- Node to convert- Returns:
- the string conversion from a single node.
-
xstr
Cast result object to a string. -
str
Cast result object to a string. -
object
Return a java object that's closest to the representation that should be handed to an extension. -
nodeset
Cast result object to a nodelist. Always issues an error.- Overrides:
nodesetin classXObject- Returns:
- null
- Throws:
TransformerException- in case of error in case of error
-
nodelist
Cast result object to a nodelist. Always issues an error.- Overrides:
nodelistin classXObject- Returns:
- null
- Throws:
TransformerException- in case of error in case of error
-
iterRaw
Return the iterator without cloning, etc. -
iter
Cast result object to a nodelist. Always issues an error. -
mutableNodeset
Cast result object to a nodelist. Always issues an error.- Overrides:
mutableNodesetin classXObject- Returns:
- The object as a NodeSetDTM.
-
compare
public boolean compare(XObject obj2, org.loboevolution.apache.xpath.objects.Comparator comparator) throws TransformerException Tell if one object is less than the other.- Parameters:
obj2- Object to compare this nodeset tocomparator- Comparator to use- Returns:
- See the comments below for each object type comparison
- Throws:
TransformerException- in case of error
-
lessThan
Tell if one object is less than the other.- Overrides:
lessThanin classXObject- Parameters:
obj2- Object to compare this to- Returns:
- True if this object is less than the given object
- Throws:
TransformerException- in case of error in case of error
-
lessThanOrEqual
Tell if one object is less than or equal to the other.- Overrides:
lessThanOrEqualin classXObject- Parameters:
obj2- Object to compare this to- Returns:
- True if this object is less than or equal to the given object
- Throws:
TransformerException- in case of error
-
greaterThan
Tell if one object is greater than the other.- Overrides:
greaterThanin classXObject- Parameters:
obj2- Object to compare this to- Returns:
- True if this object is greater than the given object
- Throws:
TransformerException- in case of error
-
greaterThanOrEqual
Tell if one object is greater than or equal to the other.- Overrides:
greaterThanOrEqualin classXObject- Parameters:
obj2- Object to compare this to- Returns:
- True if this object is greater than or equal to the given object
- Throws:
TransformerException- in case of error
-
equals
Tell if two objects are functionally equal. -
notEquals
Tell if two objects are functionally not equal.- Overrides:
notEqualsin classXObject- Parameters:
obj2- Object to compare this to- Returns:
- True if this object is not equal to the given object
- Throws:
TransformerException- in case of error
-