org.exist.xquery.value
Class NumericValue

java.lang.Object
  extended by org.exist.xquery.value.AtomicValue
      extended by org.exist.xquery.value.ComputableValue
          extended by 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


Field Summary
 
Fields inherited from class org.exist.xquery.value.AtomicValue
EMPTY_VALUE
 
Fields inherited from interface org.exist.xquery.value.Sequence
EMPTY_SEQUENCE
 
Constructor Summary
NumericValue()
           
 
Method Summary
abstract  NumericValue abs()
           
abstract  NumericValue ceiling()
           
 int compareTo(Collator collator, AtomicValue other)
           
 boolean compareTo(Collator collator, int operator, AtomicValue other)
           
abstract  AtomicValue convertTo(int requiredType)
          Convert this item into an atomic value, whose type corresponds to the specified target type.
 boolean effectiveBooleanValue()
          Get the effective boolean value of this sequence.
abstract  NumericValue floor()
           
 double getDouble()
           
 int getInt()
           
 long getLong()
           
abstract  String getStringValue()
          Return the string value of this item (see the definition of string value in XPath).
abstract  boolean hasFractionalPart()
           
abstract  IntegerValue idiv(NumericValue other)
           
abstract  boolean isInfinite()
           
abstract  boolean isNaN()
           
abstract  boolean isNegative()
           
abstract  boolean isPositive()
           
abstract  boolean isZero()
           
abstract  AtomicValue max(Collator collator, AtomicValue other)
           
abstract  AtomicValue min(Collator collator, AtomicValue other)
           
abstract  NumericValue mod(NumericValue other)
           
abstract  NumericValue negate()
           
abstract  NumericValue round()
           
abstract  NumericValue round(IntegerValue precision)
           
 
Methods inherited from class org.exist.xquery.value.ComputableValue
div, minus, mult, plus
 
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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumericValue

public NumericValue()
Method Detail

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.