Package org.eclipse.wst.xml.xpath2.processor.internal.types


org.eclipse.wst.xml.xpath2.processor.internal.types
Class XSDecimal



public class XSDecimal
extends org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType
A representation of the Decimal datatype

Constructor Summary

XSDecimal()
XSDecimal(java.math.BigDecimal x)
XSDecimal(java.lang.String x)

Method Summary

public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericTypeabs()
     Absolutes the number stored
public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericTypeceiling()
     Returns the smallest integer greater than the number stored
public org.eclipse.wst.xml.xpath2.api.ResultSequenceconstructor(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Creates a new result sequence consisting of the retrievable decimal number in the supplied result sequence
protected org.eclipse.wst.xml.xpath2.api.ItemconvertArg(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)
    
public org.eclipse.wst.xml.xpath2.api.ResultSequencediv(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical division operator between this XSDecimal and the supplied ResultSequence.
public doubledouble_value()
     Retrieves the actual value of the number stored
public booleaneq(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at , org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)
     Equality comparison between this number and the supplied representation.
public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericTypefloor()
     Returns the largest integer smaller than the number stored
public java.lang.ObjectgetNativeValue()
    
public java.lang.StringgetStringValue()
     Retrieves a String representation of the Decimal value stored
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinitiongetTypeDefinition()
    
public java.math.BigDecimalgetValue()
    
public booleangt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)
     Comparison between this number and the supplied representation.
public org.eclipse.wst.xml.xpath2.api.ResultSequenceidiv(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical integer division operator between this XSDecimal and the supplied ResultSequence. Due to no numeric type promotion or conversion, the ResultSequence must be of type XSDecimal.
protected booleanisLexicalValue(java.lang.String value)
    
public booleanlt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)
     Comparison between this number and the supplied representation.
public org.eclipse.wst.xml.xpath2.api.ResultSequenceminus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical subtraction operator between this XSDecimal and the supplied ResultSequence.
public org.eclipse.wst.xml.xpath2.api.ResultSequencemod(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical modulus operator between this XSDecimal and the supplied ResultSequence. Due to no numeric type promotion or conversion, the ResultSequence must be of type XSDecimal.
public org.eclipse.wst.xml.xpath2.api.ResultSequenceplus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical addition operator between this XSDecimal and the supplied ResultSequence. Due to no numeric type promotion or conversion, the ResultSequence must be of type XSDecimal.
public static java.math.BigDecimalremainder(java.math.BigDecimal value , java.math.BigDecimal divisor)
    
public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericTyperound()
     Returns the closest integer of the number stored.
public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericTyperound_half_to_even()
     Returns the closest integer of the number stored.
public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericTyperound_half_to_even(int precision)
     Returns the closest integer of the number stored with the specified precision.
public voidset_double(double x)
     Sets the number stored to that supplied
public java.lang.Stringstring_type()
     Retrieves the datatype's full pathname
public org.eclipse.wst.xml.xpath2.api.ResultSequencetimes(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)
     Mathematical multiplication operator between this XSDecimal and the supplied ResultSequence.
public java.lang.Stringtype_name()
     Retrieves the datatype's name
public org.eclipse.wst.xml.xpath2.api.ResultSequenceunary_minus()
     Negation of the number stored
public booleanzero()
     Check if this XSDecimal represents 0

Constructor Detail

XSDecimal

public XSDecimal()

Initiates a representation of 0.0


XSDecimal

public XSDecimal(java.math.BigDecimal x)

Initiates a representation of the supplied number


XSDecimal

public XSDecimal(java.lang.String x)


Methods Detail

abs

public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType abs()

Absolutes the number stored

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType - A XSDecimal representing the absolute value of the number stored


ceiling

public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType ceiling()

Returns the smallest integer greater than the number stored

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType - A XSDecimal representing the smallest integer greater than the number stored


constructor

public org.eclipse.wst.xml.xpath2.api.ResultSequence constructor(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Creates a new result sequence consisting of the retrievable decimal number in the supplied result sequence

Parameters

arg - The result sequence from which to extract the decimal number.

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A new result sequence consisting of the decimal number supplied.

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


convertArg

protected org.eclipse.wst.xml.xpath2.api.Item convertArg(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg)

Parameters

arg

Returns

org.eclipse.wst.xml.xpath2.api.Item

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


div

public org.eclipse.wst.xml.xpath2.api.ResultSequence div(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical division operator between this XSDecimal and the supplied ResultSequence.

Parameters

arg - The ResultSequence to perform a division with

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A XSDecimal consisting of the result of the mathematical division.

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


double_value

public double double_value()

Retrieves the actual value of the number stored

Returns

double - The actual value of the number stored


eq

public boolean eq(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType at , org.eclipse.wst.xml.xpath2.api.DynamicContext dynamicContext)

Equality comparison between this number and the supplied representation.

Parameters

at - Representation to be compared with (must currently be of type XSDecimal)

dynamicContext

Returns

boolean - True if the 2 representation represent the same number. False otherwise

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


floor

public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType floor()

Returns the largest integer smaller than the number stored

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType - A XSDecimal representing the largest integer smaller than the number stored


getNativeValue

public java.lang.Object getNativeValue()

Returns

java.lang.Object


getStringValue

public java.lang.String getStringValue()

Retrieves a String representation of the Decimal value stored

Returns

java.lang.String - String representation of the Decimal value stored


getTypeDefinition

public org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition getTypeDefinition()

Returns

org.eclipse.wst.xml.xpath2.api.typesystem.TypeDefinition


getValue

public java.math.BigDecimal getValue()

Returns

java.math.BigDecimal


gt

public boolean gt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)

Comparison between this number and the supplied representation.

Parameters

arg - Representation to be compared with (must currently be of type XSDecimal)

context

Returns

boolean - True if the supplied type represents a number smaller than this one stored. False otherwise

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


idiv

public org.eclipse.wst.xml.xpath2.api.ResultSequence idiv(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical integer division operator between this XSDecimal and the supplied ResultSequence. Due to no numeric type promotion or conversion, the ResultSequence must be of type XSDecimal.

Parameters

arg - The ResultSequence to perform an integer division with

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A XSInteger consisting of the result of the mathematical integer division.

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


isLexicalValue

protected boolean isLexicalValue(java.lang.String value)

Parameters

value

Returns

boolean


lt

public boolean lt(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType arg , org.eclipse.wst.xml.xpath2.api.DynamicContext context)

Comparison between this number and the supplied representation.

Parameters

arg - Representation to be compared with (must currently be of type XSDecimal)

context

Returns

boolean - True if the supplied type represents a number greater than this one stored. False otherwise

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


minus

public org.eclipse.wst.xml.xpath2.api.ResultSequence minus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical subtraction operator between this XSDecimal and the supplied ResultSequence.

Parameters

arg - The ResultSequence to perform a subtraction with

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A XSDecimal consisting of the result of the mathematical subtraction.

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


mod

public org.eclipse.wst.xml.xpath2.api.ResultSequence mod(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical modulus operator between this XSDecimal and the supplied ResultSequence. Due to no numeric type promotion or conversion, the ResultSequence must be of type XSDecimal.

Parameters

arg - The ResultSequence to perform a modulus with

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A XSDecimal consisting of the result of the mathematical modulus.

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


plus

public org.eclipse.wst.xml.xpath2.api.ResultSequence plus(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical addition operator between this XSDecimal and the supplied ResultSequence. Due to no numeric type promotion or conversion, the ResultSequence must be of type XSDecimal.

Parameters

arg - The ResultSequence to perform an addition with

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A XSDecimal consisting of the result of the mathematical addition.

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


remainder

public java.math.BigDecimal remainder(java.math.BigDecimal value , java.math.BigDecimal divisor)

Parameters

value

divisor

Returns

java.math.BigDecimal


round

public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType round()

Returns the closest integer of the number stored.

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType - A XSDecimal representing the closest long of the number stored.


round_half_to_even

public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType round_half_to_even()

Returns the closest integer of the number stored.

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType - A XSDecimal representing the closest long of the number stored.


round_half_to_even

public org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType round_half_to_even(int precision)

Returns the closest integer of the number stored with the specified precision.

Parameters

precision - An integer precision

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.NumericType - A XSDecimal representing the closest long of the number stored.


set_double

public void set_double(double x)

Sets the number stored to that supplied

Parameters

x - Number to be stored


string_type

public java.lang.String string_type()

Retrieves the datatype's full pathname

Returns

java.lang.String - "xs:decimal" which is the datatype's full pathname


times

public org.eclipse.wst.xml.xpath2.api.ResultSequence times(org.eclipse.wst.xml.xpath2.api.ResultSequence arg)

Mathematical multiplication operator between this XSDecimal and the supplied ResultSequence.

Parameters

arg - The ResultSequence to perform a multiplication with

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A XSDecimal consisting of the result of the mathematical multiplication.


type_name

public java.lang.String type_name()

Retrieves the datatype's name

Returns

java.lang.String - "decimal" which is the datatype's name


unary_minus

public org.eclipse.wst.xml.xpath2.api.ResultSequence unary_minus()

Negation of the number stored

Returns

org.eclipse.wst.xml.xpath2.api.ResultSequence - A XSDecimal representing the negation of this XSDecimal


zero

public boolean zero()

Check if this XSDecimal represents 0

Returns

boolean - True if this XSDecimal represents 0. False otherwise