org.apache.xpath.objects
Class XNumber
- Cloneable, Serializable, ExpressionNode, SourceLocator, XPathVisitable
This class represents an XPath number, and is capable of
converting the number to other types, such as a string.
XNumber(Number num)- Construct a XNodeSet object.
|
XNumber(double d)- Construct a XNodeSet object.
|
boolean | bool()- Cast result object to a boolean.
|
void | callVisitors(ExpressionOwner owner, XPathVisitor visitor)
|
boolean | equals(XObject obj2)- Tell if two objects are functionally equal.
|
int | getType()- Tell that this is a CLASS_NUMBER.
|
String | getTypeString()- Given a request type, return the equivalent string.
|
boolean | isStableNumber()- Tell if this expression returns a stable number that will not change during
iterations within the expression.
|
double | num()- Cast result object to a number.
|
double | num(XPathContext xctxt)- Evaluate expression to a number.
|
Object | object()- Return a java object that's closest to the representation
that should be handed to an extension.
|
String | str()- Cast result object to a string.
|
allowDetachToRelease, appendToFsb, bool, boolWithSideEffects, callVisitors, castToType, create, create, deepEquals, destruct, detach, dispatchCharactersEvents, equals, execute, fixupVariables, getFresh, getType, getTypeString, greaterThan, greaterThanOrEqual, iter, lessThan, lessThanOrEqual, mutableNodeset, nodelist, nodeset, notEquals, num, numWithSideEffects, object, reset, rtf, rtf, rtree, rtree, str, toString, xstr |
asIterator, asIteratorRaw, asNode, assertion, bool, canTraverseOutsideSubtree, deepEquals, error, execute, execute, execute, execute, executeCharsToContentHandler, exprAddChild, exprGetChild, exprGetNumChildren, exprGetParent, exprSetParent, fixupVariables, getColumnNumber, getExpressionOwner, getLineNumber, getPublicId, getSystemId, isNodesetExpr, isStableNumber, num, warn, xstr |
XNumber
public XNumber(Number num)
Construct a XNodeSet object.
XNumber
public XNumber(double d)
Construct a XNodeSet object.
bool
public boolean bool()
Cast result object to a boolean.
- bool in interface XObject
- false if the value is NaN or equal to 0.0
equals
public boolean equals(XObject obj2)
Tell if two objects are functionally equal.
- equals in interface XObject
obj2 - Object to compare this to
- true if the two objects are equal
getType
public int getType()
Tell that this is a CLASS_NUMBER.
- getType in interface XObject
getTypeString
public String getTypeString()
Given a request type, return the equivalent string.
For diagnostic purposes.
- getTypeString in interface XObject
isStableNumber
public boolean isStableNumber()
Tell if this expression returns a stable number that will not change during
iterations within the expression. This is used to determine if a proximity
position predicate can indicate that no more searching has to occur.
- isStableNumber in interface Expression
- true if the expression represents a stable number.
num
public double num()
Cast result object to a number.
- num in interface XObject
- the value of the XNumber object
num
public double num(XPathContext xctxt)
throws javax.xml.transform.TransformerException Evaluate expression to a number.
- num in interface Expression
object
public Object object()
Return a java object that's closest to the representation
that should be handed to an extension.
- object in interface XObject
- The value of this XNumber as a Double object
str
public String str()
Cast result object to a string.
- str in interface XObject
- "NaN" if the number is NaN, Infinity or -Infinity if
the number is infinite or the string value of the number.
Copyright B) 2004 Apache XML Project. All Rights Reserved.