org.ucl.xpath.types
Class XSInteger

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
                      extended byorg.ucl.xpath.types.XSDecimal
                          extended byorg.ucl.xpath.types.XSInteger
All Implemented Interfaces:
CmpEq, CmpGt, CmpLt, MathDiv, MathIDiv, MathMinus, MathMod, MathPlus, MathTimes

public class XSInteger
extends XSDecimal

A representation of the Integer datatype


Constructor Summary
XSInteger()
          Initialises a representation of 0
XSInteger(int x)
          Initialises a representation of the supplied integer
 
Method Summary
 NumericType abs()
          Absolutes the integer stored
 ResultSequence constructor(ResultSequence arg)
          Creates a new ResultSequence consisting of the extractable integer in the supplied ResultSequence
 int int_value()
          Retrieves the actual integer value stored
 ResultSequence minus(ResultSequence arg)
          Mathematical subtraction operator between this XSInteger and the supplied ResultSequence.
 ResultSequence mod(ResultSequence arg)
          Mathematical modulus operator between this XSInteger and the supplied ResultSequence.
 ResultSequence plus(ResultSequence arg)
          Mathematical addition operator between this XSInteger and the supplied ResultSequence.
 void set_int(int x)
          Sets the integer stored to that supplied
 java.lang.String string_type()
          Retrieves the datatype's full pathname
 java.lang.String string_value()
          Retrieves a String representation of the integer stored
 ResultSequence times(ResultSequence arg)
          Mathematical multiplication operator between this XSInteger and the supplied ResultSequence.
 java.lang.String type_name()
          Retrieves the datatype's name
 ResultSequence unary_minus()
          Negates the integer stored
 boolean zero()
          Check whether the integer represented is 0
 
Methods inherited from class org.ucl.xpath.types.XSDecimal
ceiling, div, double_value, eq, floor, gt, idiv, lt, round_half_to_even, round, set_double
 
Methods inherited from class org.ucl.xpath.types.NumericType
get_single_arg, get_single_type, get_single_type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XSInteger

public XSInteger()
Initialises a representation of 0


XSInteger

public XSInteger(int x)
Initialises a representation of the supplied integer

Parameters:
x - Integer to be stored
Method Detail

string_type

public java.lang.String string_type()
Retrieves the datatype's full pathname

Overrides:
string_type in class XSDecimal
Returns:
"xs:integer" which is the datatype's full pathname

type_name

public java.lang.String type_name()
Retrieves the datatype's name

Overrides:
type_name in class XSDecimal
Returns:
"integer" which is the datatype's name

string_value

public java.lang.String string_value()
Retrieves a String representation of the integer stored

Overrides:
string_value in class XSDecimal
Returns:
String representation of the integer stored

zero

public boolean zero()
Check whether the integer represented is 0

Overrides:
zero in class XSDecimal
Returns:
True is the integer represented is 0. False otherwise

constructor

public ResultSequence constructor(ResultSequence arg)
                           throws DynamicError
Creates a new ResultSequence consisting of the extractable integer in the supplied ResultSequence

Overrides:
constructor in class XSDecimal
Parameters:
arg - The ResultSequence from which the integer is to be extracted
Returns:
New ResultSequence consisting of the integer supplied
Throws:
DynamicError

int_value

public int int_value()
Retrieves the actual integer value stored

Returns:
The actual integer value stored

set_int

public void set_int(int x)
Sets the integer stored to that supplied

Parameters:
x - Integer to be stored

plus

public ResultSequence plus(ResultSequence arg)
                    throws DynamicError
Mathematical addition operator between this XSInteger and the supplied ResultSequence. Due to no numeric type promotion or conversion, the ResultSequence must be of type XSInteger.

Specified by:
plus in interface MathPlus
Overrides:
plus in class XSDecimal
Parameters:
arg - The ResultSequence to perform an addition with
Returns:
A XSInteger consisting of the result of the mathematical addition.
Throws:
DynamicError

minus

public ResultSequence minus(ResultSequence arg)
                     throws DynamicError
Mathematical subtraction operator between this XSInteger and the supplied ResultSequence. Due to no numeric type promotion or conversion, the ResultSequence must be of type XSInteger.

Specified by:
minus in interface MathMinus
Overrides:
minus in class XSDecimal
Parameters:
arg - The ResultSequence to perform a subtraction with
Returns:
A XSInteger consisting of the result of the mathematical subtraction.
Throws:
DynamicError

times

public ResultSequence times(ResultSequence arg)
                     throws DynamicError
Mathematical multiplication operator between this XSInteger and the supplied ResultSequence. Due to no numeric type promotion or conversion, the ResultSequence must be of type XSInteger.

Specified by:
times in interface MathTimes
Overrides:
times in class XSDecimal
Parameters:
arg - The ResultSequence to perform a multiplication with
Returns:
A XSInteger consisting of the result of the mathematical multiplication.
Throws:
DynamicError

mod

public ResultSequence mod(ResultSequence arg)
                   throws DynamicError
Mathematical modulus operator between this XSInteger and the supplied ResultSequence. Due to no numeric type promotion or conversion, the ResultSequence must be of type XSInteger.

Specified by:
mod in interface MathMod
Overrides:
mod in class XSDecimal
Parameters:
arg - The ResultSequence to perform a modulus with
Returns:
A XSInteger consisting of the result of the mathematical modulus.
Throws:
DynamicError

unary_minus

public ResultSequence unary_minus()
Negates the integer stored

Overrides:
unary_minus in class XSDecimal
Returns:
New XSInteger representing the negation of the integer stored

abs

public NumericType abs()
Absolutes the integer stored

Overrides:
abs in class XSDecimal
Returns:
New XSInteger representing the abolsute of the integer stored