| java.lang.Object net.sf.saxon.value.Value net.sf.saxon.value.AtomicValue net.sf.saxon.value.NumericValue
All known Subclasses: net.sf.saxon.value.FloatValue, net.sf.saxon.value.BigIntegerValue, net.sf.saxon.value.IntegerValue, net.sf.saxon.value.DoubleValue, net.sf.saxon.value.DecimalValue,
NumericValue | abstract public class NumericValue extends AtomicValue implements Comparable(Code) | | NumericValue is an abstract superclass for IntegerValue, DecimalValue,
FloatValue, and DoubleValue
|
ceiling | abstract public NumericValue ceiling()(Code) | | Implement the XPath ceiling() function
a value, of the same type as that supplied, rounded towardsplus infinity |
compareTo | public int compareTo(Object other)(Code) | | Compare the value to another numeric value
exception: ClassCastException - if the other value is not a NumericValue(the parameter is declared as Object to satisfy the Comparableinterface) Parameters: other - The other numeric value -1 if this one is the lower, 0 if they are numerically equal,+1 if this one is the higher. |
equals | final public boolean equals(Object other)(Code) | | The equals() function compares numeric equality among integers, decimals, floats, doubles, and
their subtypes
Parameters: other - the value to be compared with this one true if the two values are numerically equal |
floor | abstract public NumericValue floor()(Code) | | Implement the XPath floor() function
a value, of the same type as that supplied, rounded towardsminus infinity |
getDoubleValue | public double getDoubleValue()(Code) | | Get the numeric value as a double
A double representing this numeric value; NaN if it cannot beconverted |
hashCode | abstract public int hashCode()(Code) | | hashCode() must be the same for two values that are equal. One
way to ensure this is to convert the value to a double, and take the
hashCode of the double. But this is expensive in the common case where
we are comparing integers. So we adopt the rule: for values that are in
the range of a Java Integer, we use the int value as the hashcode. For
values outside that range, we convert to a double and take the hashCode of
the double. This method needs to have a compatible implementation in
each subclass.
the hash code of the numeric value |
isInteger | public static boolean isInteger(AtomicValue value)(Code) | | Test whether the value is an integer (an instance of a subtype of xs:integer)
|
isNaN | public boolean isNaN()(Code) | | Test whether the value is the double/float value NaN
|
isWholeNumber | abstract public boolean isWholeNumber()(Code) | | Determine whether the value is a whole number, that is, whether it compares
equal to some integer
true if the value is a whole number |
negate | abstract public NumericValue negate()(Code) | | Change the sign of the number
a value, of the same type as the original, with its signinverted |
parseNumber | public static NumericValue parseNumber(String in)(Code) | | Get a numeric value by parsing a string; the type of numeric value depends
on the lexical form of the string, following the rules for XPath numeric
literals.
Parameters: in - the input string a NumericValue representing the value of the string. Returns Double.NaN if thevalue cannot be parsed as a string. |
promote | public static ItemType promote(ItemType v1, ItemType v2, TypeHierarchy typeHierarchy)(Code) | | Identify lowest common supertype of two numeric values for promotion purposes
Parameters: v1 - the item type of the first operand Parameters: v2 - the item type of the second operand Parameters: typeHierarchy - the item type that should be used for arithmetic betweenoperands of the two specified item types |
round | abstract public NumericValue round()(Code) | | Implement the XPath round() function
a value, of the same type as that supplied, rounded towards thenearest whole number (0.5 rounded up) |
roundToHalfEven | abstract public NumericValue roundToHalfEven(int scale)(Code) | | Implement the XPath 2.0 round-to-half-even() function
Parameters: scale - the decimal position for rounding: e.g. 2 rounds to amultiple of 0.01, while -2 rounds to a multiple of 100 a value, of the same type as the original, rounded towards thenearest multiple of 10**(-scale), with rounding towards the nearesteven number if two values are equally near |
signum | abstract public double signum()(Code) | | Determine whether the value is negative, zero, or positive
-1 if negative, 0 if zero (including negative zero), +1 if positive, NaN if NaN |
toString | public String toString()(Code) | | Produce a string representation of the value
The result of casting the number to a string |
Fields inherited from net.sf.saxon.value.Value | final public static Class[] EMPTY_CLASS_ARRAY(Code)(Java Doc)
|
Methods inherited from net.sf.saxon.value.Value | public static Item asItem(ValueRepresentation value, XPathContext context) throws XPathException(Code)(Java Doc) public static SequenceIterator asIterator(ValueRepresentation val, XPathContext context) throws XPathException(Code)(Java Doc) public static Value asValue(ValueRepresentation val)(Code)(Java Doc) public void checkPermittedContents(SchemaType parentType, StaticContext env, boolean whole) throws XPathException(Code)(Java Doc) public static CharSequence collapseWhitespace(CharSequence in)(Code)(Java Doc) public static Object convert(Item item) throws XPathException(Code)(Java Doc) public static Value convertJavaObjectToXPath(Object object, SequenceType requiredType, Configuration config) throws XPathException(Code)(Java Doc) public Object convertToJava(Class target, XPathContext context) throws XPathException(Code)(Java Doc) public void display(int level, NamePool pool, PrintStream out)(Code)(Java Doc) public boolean effectiveBooleanValue(XPathContext context) throws XPathException(Code)(Java Doc) public boolean equals(Object obj)(Code)(Java Doc) public String evaluateAsString(XPathContext context) throws XPathException(Code)(Java Doc) public Item evaluateItem(XPathContext context) throws XPathException(Code)(Java Doc) public int getCardinality()(Code)(Java Doc) final public int getDependencies()(Code)(Java Doc) public ItemType getItemType(TypeHierarchy th)(Code)(Java Doc) public static SequenceIterator getIterator(ValueRepresentation val) throws XPathException(Code)(Java Doc) public int getLength() throws XPathException(Code)(Java Doc) final public Container getParentExpression()(Code)(Java Doc) public int getSpecialProperties()(Code)(Java Doc) public String getStringValue() throws XPathException(Code)(Java Doc) public int hashCode()(Code)(Java Doc) public Item itemAt(int n) throws XPathException(Code)(Java Doc) final public Iterator iterateSubExpressions()(Code)(Java Doc) public static QNameValue makeQNameValue(Object object, Configuration config)(Code)(Java Doc) public static CharSequence normalizeWhitespace(CharSequence in)(Code)(Java Doc) final public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType)(Code)(Java Doc) public void process(XPathContext context) throws XPathException(Code)(Java Doc) final public Expression promote(PromotionOffer offer)(Code)(Java Doc) public Value reduce() throws XPathException(Code)(Java Doc) public boolean schemaEquals(Value obj)(Code)(Java Doc) final public Expression simplify(StaticContext env)(Code)(Java Doc) public static double stringToNumber(CharSequence s) throws NumberFormatException(Code)(Java Doc) public String toString()(Code)(Java Doc) public static CharSequence trimWhitespace(CharSequence in)(Code)(Java Doc) final public Expression typeCheck(StaticContext env, ItemType contextItemType)(Code)(Java Doc)
|
|
|