com.icl.saxon.expr
public abstract class Value extends Expression
Field Summary | |
---|---|
static int | ANY |
static int | BOOLEAN
Constants denoting the data types of an expression or value |
static int | NODESET |
static int | NUMBER |
static int | OBJECT |
static int | STRING |
Method Summary | |
---|---|
abstract boolean | asBoolean()
Convert the value to a Boolean |
abstract double | asNumber()
Convert the value to a Number |
abstract String | asString()
Convert the value to a String value |
boolean | compare(int operator, Value other)
Test how a Value compares to another Value under a relational comparison.
|
abstract int | conversionPreference(Class required)
Get conversion preference for this value to a Java class. |
abstract Object | convertToJava(Class target)
Convert to Java object (for passing to external functions) |
boolean | equals(Value other)
Test whether two values are equal. |
Value | evaluate(Context context)
Evaluate the Value. |
int | getDependencies()
Determine which aspects of the context the expression depends on. |
protected static int | inverse(int operator)
Return the inverse of a relational operator, so that "a op b" can be
rewritten as "b inverse(op) a" |
boolean | notEquals(Value other)
Test whether two values are not-equal. |
protected boolean | numericCompare(int operator, double x, double y) |
Expression | reduce(int dependencies, Context context)
Perform a partial evaluation of the expression, by eliminating specified dependencies
on the context. |
Expression | simplify()
Simplify an expression |
static double | stringToNumber(String s)
Static method to convert strings to numbers. |
Returns: the value converted to a Boolean
Returns: the value converted to a String
Returns: the value converted to a String
Parameters: operator The comparison operator, one of Tokenizer.LE, Tokenizer.LT, Tokenizer.GE, Tokenizer.GT, Tokenizer.EQUALS, Tokenizer.NE.
Parameters: target The class required by the external function
Returns: an object of the target class
Returns: a boolean giving the value of the expression, evaluated in the current context
Parameters: context The context (not used)
Returns: the value, unchanged
Returns: a boolean giving the value of the expression, evaluated in the current context
Parameters: dependencies The dependencies to be removed context The context to be used for the partial evaluation
Returns: a new expression that does not have any of the specified dependencies
Returns: the simplified expression
Parameters: s the String to be converted
Returns: a double representing the value of the String; if it cannot be converted, return NaN (as required by the XSL specification)