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_next
Fields inherited from class org.loboevolution.apache.xpath.objects.XObject
CLASS_BOOLEAN, CLASS_NODESET, CLASS_NULL, CLASS_NUMBER, CLASS_RTREEFRAG, CLASS_STRING, CLASS_UNKNOWN, m_obj
Fields inherited from interface org.loboevolution.apache.xml.dtm.DTMIterator
FILTER_ACCEPT, FILTER_SKIP
-
Constructor Summary
ConstructorDescriptionXNodeSet
(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 TypeMethodDescriptionboolean
bool()
Cast result object to a boolean.boolean
Cast result object to a boolean, but allow side effects, such as the incrementing of an iterator.boolean
Tell if one object is less than the other.boolean
Tell if two objects are functionally equal.double
getNumberFromNode
(int n) Get numeric value of the string conversion from a single node.getStringFromNode
(int n) Get the string conversion from a single node.int
getType()
Tell what kind of class this is.Given a request type, return the equivalent string.boolean
greaterThan
(XObject obj2) Tell if one object is greater than the other.boolean
greaterThanOrEqual
(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.boolean
Tell if one object is less than the other.boolean
lessThanOrEqual
(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.boolean
Tell if two objects are functionally not equal.double
num()
Cast result object to a number.double
Cast 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, SetVector
Methods inherited from class org.loboevolution.apache.xpath.objects.XObject
callVisitors, deepEquals, error, error, execute, toString
Methods 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:
getTypeString
in 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:
numWithSideEffects
in 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:
boolWithSideEffects
in 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:
nodeset
in 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:
nodelist
in 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:
mutableNodeset
in 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:
lessThan
in 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:
lessThanOrEqual
in 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:
greaterThan
in 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:
greaterThanOrEqual
in 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:
notEquals
in 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
-