org.ucl.xpath.types
Class NumericType

java.lang.Object
  extended byorg.ucl.xpath.types.AnyType
      extended byorg.ucl.xpath.types.AnySimpleType
          extended byorg.ucl.xpath.types.AnyAtomicType
              extended byorg.ucl.xpath.types.CtrType
                  extended byorg.ucl.xpath.types.NumericType
All Implemented Interfaces:
CmpEq, CmpGt, CmpLt, MathDiv, MathIDiv, MathMinus, MathMod, MathPlus, MathTimes
Direct Known Subclasses:
XSDecimal, XSDouble, XSFloat

public abstract class NumericType
extends CtrType
implements CmpEq, CmpGt, CmpLt, MathPlus, MathMinus, MathTimes, MathDiv, MathIDiv, MathMod

A representation of the NumericType datatype


Constructor Summary
NumericType()
           
 
Method Summary
abstract  NumericType abs()
          Absolutes the number stored
abstract  NumericType ceiling()
          Returns the smallest integer greater than the number stored
abstract  NumericType floor()
          Returns the largest integer smaller than the number stored
protected  AnyType get_single_arg(ResultSequence rs)
           
static AnyType get_single_type(AnyType at, java.lang.Class type)
          Check whether the supplied node is of the supplied type
static AnyType get_single_type(ResultSequence rs, java.lang.Class type)
          Check whether first node in supplied ResultSequence is of the supplied type
abstract  NumericType round_half_to_even()
          Returns the closest integer of the number stored.
abstract  NumericType round()
          Returns the closest integer of the number stored.
abstract  ResultSequence unary_minus()
          Creates a new ResultSequence representing the negation of the number stored
abstract  boolean zero()
          Check whether node represnts 0
 
Methods inherited from class org.ucl.xpath.types.CtrType
constructor, type_name
 
Methods inherited from class org.ucl.xpath.types.AnyType
string_type, string_value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ucl.xpath.function.CmpEq
eq
 
Methods inherited from interface org.ucl.xpath.function.CmpGt
gt
 
Methods inherited from interface org.ucl.xpath.function.CmpLt
lt
 
Methods inherited from interface org.ucl.xpath.function.MathPlus
plus
 
Methods inherited from interface org.ucl.xpath.function.MathMinus
minus
 
Methods inherited from interface org.ucl.xpath.function.MathTimes
times
 
Methods inherited from interface org.ucl.xpath.function.MathDiv
div
 
Methods inherited from interface org.ucl.xpath.function.MathIDiv
idiv
 
Methods inherited from interface org.ucl.xpath.function.MathMod
mod
 

Constructor Detail

NumericType

public NumericType()
Method Detail

zero

public abstract boolean zero()
Check whether node represnts 0

Returns:
True if node represnts 0. False otherwise

unary_minus

public abstract ResultSequence unary_minus()
Creates a new ResultSequence representing the negation of the number stored

Returns:
New ResultSequence representing the negation of the number stored

abs

public abstract NumericType abs()
Absolutes the number stored

Returns:
New NumericType representing the absolute of the number stored

ceiling

public abstract NumericType ceiling()
Returns the smallest integer greater than the number stored

Returns:
A NumericType representing the smallest integer greater than the number stored

floor

public abstract NumericType floor()
Returns the largest integer smaller than the number stored

Returns:
A NumericType representing the largest integer smaller than the number stored

round

public abstract NumericType round()
Returns the closest integer of the number stored.

Returns:
A NumericType representing the closest long of the number stored.

round_half_to_even

public abstract NumericType round_half_to_even()
Returns the closest integer of the number stored.

Returns:
A NumericType representing the closest long of the number stored.

get_single_arg

protected AnyType get_single_arg(ResultSequence rs)
                          throws DynamicError
Throws:
DynamicError

get_single_type

public static AnyType get_single_type(AnyType at,
                                      java.lang.Class type)
                               throws DynamicError
Check whether the supplied node is of the supplied type

Parameters:
at - The node being tested
type - The type expected
Returns:
The node being tested
Throws:
DynamicError - If node being tested is not of expected type

get_single_type

public static AnyType get_single_type(ResultSequence rs,
                                      java.lang.Class type)
                               throws DynamicError
Check whether first node in supplied ResultSequence is of the supplied type

Parameters:
rs - The node being tested
type - The type expected
Returns:
The node being tested
Throws:
DynamicError - If node being tested is not of expected type