org.exist.xquery.value
Class NumericValue
java.lang.Object
org.exist.xquery.value.AtomicValue
org.exist.xquery.value.ComputableValue
org.exist.xquery.value.NumericValue
- All Implemented Interfaces:
- Comparable, Indexable, Item, Sequence
- Direct Known Subclasses:
- DecimalValue, DoubleValue, FloatValue, IntegerValue
public abstract class NumericValue
- extends ComputableValue
Methods inherited from class org.exist.xquery.value.AtomicValue |
add, addAll, atomize, clearContext, compareTo, contains, conversionPreference, copyTo, dump, endsWith, getCardinality, getCollectionIterator, getDocumentSet, getItemCount, getItemType, getState, getType, hasChanged, hasMany, hasOne, isCacheable, isCached, isEmpty, isPersistentSet, itemAt, iterate, nodeMoved, promote, removeDuplicates, serializeValue, setIsCached, setSelfAsContext, startsWith, toJavaObject, toMemNodeSet, toNodeSet, toSAX, toSequence, toString, unorderedIterator |
NumericValue
public NumericValue()
getStringValue
public abstract String getStringValue()
throws XPathException
- Description copied from interface:
Item
- Return the string value of this item (see the definition of string value in XPath).
- Specified by:
getStringValue
in interface Item
- Specified by:
getStringValue
in interface Sequence
- Specified by:
getStringValue
in class ComputableValue
- Throws:
XPathException
convertTo
public abstract AtomicValue convertTo(int requiredType)
throws XPathException
- Description copied from interface:
Item
- Convert this item into an atomic value, whose type corresponds to
the specified target type. requiredType should be one of the type
constants defined in
Type
. An XPathException
is thrown
if the conversion is impossible.
- Specified by:
convertTo
in interface Item
- Specified by:
convertTo
in interface Sequence
- Specified by:
convertTo
in class ComputableValue
- Parameters:
requiredType
- one of the type constants defined in class Type
- Throws:
XPathException
getDouble
public double getDouble()
throws XPathException
- Throws:
XPathException
getLong
public long getLong()
throws XPathException
- Throws:
XPathException
getInt
public int getInt()
throws XPathException
- Throws:
XPathException
hasFractionalPart
public abstract boolean hasFractionalPart()
isNaN
public abstract boolean isNaN()
isInfinite
public abstract boolean isInfinite()
isZero
public abstract boolean isZero()
isNegative
public abstract boolean isNegative()
isPositive
public abstract boolean isPositive()
effectiveBooleanValue
public boolean effectiveBooleanValue()
throws XPathException
- Description copied from interface:
Sequence
- Get the effective boolean value of this sequence. Will be false if the sequence is empty,
true otherwise.
- Specified by:
effectiveBooleanValue
in interface Sequence
- Specified by:
effectiveBooleanValue
in class AtomicValue
- Throws:
XPathException
compareTo
public boolean compareTo(Collator collator,
int operator,
AtomicValue other)
throws XPathException
- Specified by:
compareTo
in class ComputableValue
- Throws:
XPathException
compareTo
public int compareTo(Collator collator,
AtomicValue other)
throws XPathException
- Specified by:
compareTo
in class ComputableValue
- Throws:
XPathException
negate
public abstract NumericValue negate()
throws XPathException
- Throws:
XPathException
ceiling
public abstract NumericValue ceiling()
throws XPathException
- Throws:
XPathException
floor
public abstract NumericValue floor()
throws XPathException
- Throws:
XPathException
round
public abstract NumericValue round()
throws XPathException
- Throws:
XPathException
round
public abstract NumericValue round(IntegerValue precision)
throws XPathException
- Throws:
XPathException
mod
public abstract NumericValue mod(NumericValue other)
throws XPathException
- Throws:
XPathException
idiv
public abstract IntegerValue idiv(NumericValue other)
throws XPathException
- Throws:
XPathException
abs
public abstract NumericValue abs()
throws XPathException
- Throws:
XPathException
max
public abstract AtomicValue max(Collator collator,
AtomicValue other)
throws XPathException
- Specified by:
max
in class ComputableValue
- Throws:
XPathException
min
public abstract AtomicValue min(Collator collator,
AtomicValue other)
throws XPathException
- Specified by:
min
in class ComputableValue
- Throws:
XPathException
Copyright (C) Wolfgang Meier. All rights reserved.