org.inria.ns.reflex.processor.asl.types.xs
Class NumericData

java.lang.Object
  extended by org.inria.ns.reflex.processor.asl.types.TypedData.Impl
      extended by org.inria.ns.reflex.processor.asl.types.xs.NumericData
All Implemented Interfaces:
TypedData, Ignorable, IgnorableData, Unwrappable, XOperable

public class NumericData
extends TypedData.Impl

The typed data for numerics.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.processor.asl.types.TypedData
TypedData.DefaultTypedData, TypedData.Impl
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.structures.Unwrappable
Unwrappable.Unwrapper
 
Field Summary
 
Fields inherited from interface org.inria.ns.reflex.processor.asl.types.TypedData
TYPE_XOP
 
Fields inherited from interface org.inria.ns.reflex.structures.Unwrappable
UNWRAPPER
 
Constructor Summary
NumericData(Type type, Number number)
          Construct a new number that has no remainder and for which the lexical value is its canonical value.
NumericData(Type type, Number number, String lexicalValue)
          Construct a new number that has no remainder.
NumericData(Type type, Number number, String lexicalValue, String remainder)
          Construct a new number.
 
Method Summary
 String getCanonicalValue()
          Return the canonical value of the underlying number.
 String getLexicalValue()
          Return the lexical value of the underlying number.
 Number getNumber()
          Return the wrapped number.
 String getRemainder()
          Get the remainder after building this data.
 Type getType()
          Get the type of the data.
 void setValue(Object value)
          Set the value of this data.
 String toString()
          Return the string value of the underlying number.
 Object unwrap()
          Get the data.
 
Methods inherited from class org.inria.ns.reflex.processor.asl.types.TypedData.Impl
getNonIgnorableRemainder, getXOperator, ignore, isIgnorable, setIgnorable, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumericData

public NumericData(Type type,
                   Number number,
                   String lexicalValue,
                   String remainder)
Construct a new number.

Parameters:
type - A numeric type.
number - The number.
lexicalValue - The lexical value of the number.
remainder - The remainder after parsing.

NumericData

public NumericData(Type type,
                   Number number,
                   String lexicalValue)
Construct a new number that has no remainder.

Parameters:
type - A numeric type.
number - The number.
lexicalValue - The lexical value of the number.

NumericData

public NumericData(Type type,
                   Number number)
Construct a new number that has no remainder and for which the lexical value is its canonical value.

Parameters:
type - A numeric type.
number - The number.
Method Detail

setValue

public void setValue(Object value)
              throws TypeFormatException
Set the value of this data.

Parameters:
value - The value to set.
Throws:
TypeFormatException - When the value is not of the type expected.
See Also:
TypedData.setValue(java.lang.Object)

getNumber

public Number getNumber()
Return the wrapped number.

Returns:
The number.

unwrap

public Object unwrap()
Get the data.

Returns:
The data.

getRemainder

public String getRemainder()
Get the remainder after building this data.

Returns:
The not null remainder.

getType

public Type getType()
Get the type of the data.

Returns:
The type of the data.

getCanonicalValue

public String getCanonicalValue()
Return the canonical value of the underlying number.

Returns:
The canonical value of the underlying number.

getLexicalValue

public String getLexicalValue()
Return the lexical value of the underlying number.

Returns:
The lexical value of the underlying number.

toString

public String toString()
Return the string value of the underlying number.

Overrides:
toString in class TypedData.Impl
Returns:
The string value of the underlying number.
See Also:
Object.toString()