public abstract class VariantBase extends Object implements Variant
Constructor and Description |
---|
VariantBase() |
Modifier and Type | Method and Description |
---|---|
NodeIterator |
convertToNodeSet()
Returns this Variant converted to a node set.
|
double |
convertToNumber()
Returns this Variant converted to a double.
|
boolean |
convertToPredicate(ExprContext context)
Used by the implementation, not useful for the application programmer.
|
static Variant |
create(Object obj)
Converts a Java object to the proper type of Variant, based on its class.
|
boolean |
isBoolean()
Returns
true if this Variant is a boolean value. |
boolean |
isNodeSet()
Returns
true if this Variant is a node set value. |
boolean |
isNumber()
Returns
true if this Variant is a double value. |
boolean |
isString()
Returns
true if this Variant is a string value. |
Variant |
makePermanent()
Used to convert a node set Variant to a permanent node set Variant.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convertToBoolean, convertToObject, convertToString, toString
public Variant makePermanent() throws EvalException
Variant
makePermanent
in interface Variant
EvalException
- if the equivalent permanent node set cannot be
created (remember that node set are almost always lazily evaluated)NodeSetVariant
,
PermanentNodeSetVariant
public NodeIterator convertToNodeSet() throws EvalException
Variant
convertToNodeSet
in interface Variant
EvalException
- if this Variant cannot be converted to a node
set.public double convertToNumber() throws EvalException
Variant
convertToNumber
in interface Variant
EvalException
- if this Variant cannot be converted to a double.public boolean convertToPredicate(ExprContext context) throws EvalException
Variant
convertToPredicate
in interface Variant
EvalException
public boolean isBoolean()
Variant
true
if this Variant is a boolean value.public boolean isNumber()
Variant
true
if this Variant is a double value.public boolean isString()
Variant
true
if this Variant is a string value.public boolean isNodeSet()
Variant
true
if this Variant is a node set value.public static Variant create(Object obj)
StringVariant
for a java.lang.String.