public class PermanentNodeSetVariant extends VariantBase
NodeIterator
) value.
A NodeSetVariant
is an ephemeral object: it cannot be stored for
later use, it must be immediately converted and used. And this conversion
may occur only once.
Unlike the NodeSetVariant, a PermanentNodeSetVariant is not an ephemeral object: it can be stored for later use (as long as the document is not modified) and it can be converted several times.
Constructor and Description |
---|
PermanentNodeSetVariant(NodeIterator iter)
Constructs a Variant for specified node set.
|
Modifier and Type | Method and Description |
---|---|
boolean |
convertToBoolean()
Returns this Variant converted to a boolean.
|
NodeIterator |
convertToNodeSet()
Returns this Variant converted to a node set.
|
double |
convertToNumber()
Returns this Variant converted to a double.
|
Object |
convertToObject()
Returns this Variant converted to an alien Java object (typically
returned by an extension function invoked using Java introspection).
|
String |
convertToString()
Returns this Variant converted to a string.
|
boolean |
isNodeSet()
Returns
true if this Variant is a node set value. |
String |
toString()
Returns a string representation of this Variant which is useful when
debugging or when testing this implementation of XPath.
|
convertToPredicate, create, isBoolean, isNumber, isString, makePermanent
public PermanentNodeSetVariant(NodeIterator iter) throws EvalException
EvalException
- if an EvalException is thrown during the copy of
the nodes contained in specified node setpublic NodeIterator convertToNodeSet()
Variant
convertToNodeSet
in interface Variant
convertToNodeSet
in class VariantBase
public Object convertToObject()
Variant
public String convertToString() throws EvalException
Variant
EvalException
- if this Variant cannot be converted to a string.public boolean convertToBoolean() throws EvalException
Variant
EvalException
- if this Variant cannot be converted to a
boolean.public double convertToNumber() throws EvalException
Variant
convertToNumber
in interface Variant
convertToNumber
in class VariantBase
EvalException
- if this Variant cannot be converted to a double.public boolean isNodeSet()
Variant
true
if this Variant is a node set value.isNodeSet
in interface Variant
isNodeSet
in class VariantBase