de.dante.extex.interpreter.type.real
Class Real

java.lang.Object
  extended byde.dante.extex.interpreter.type.real.Real
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ImmutableReal

public class Real
extends java.lang.Object
implements java.io.Serializable

Real (with a double value)

Version:
$Revision: 1.11 $
Author:
Michael Niedermair
See Also:
Serialized Form

Field Summary
static Real MAX_VALUE
          max-Real
static Real ZERO
          ZERO-Real
 
Constructor Summary
Real(Context context, TokenSource source)
          Creates a new object.
Real(double val)
          Creates a new object.
Real(float val)
          Creates a new object.
Real(int i)
          Creates a new object.
Real(long l)
          Creates a new object.
Real(Real val)
          Creates a new object.
Real(java.lang.String s)
          Creates a new object.
 
Method Summary
 void add(double val)
          add
 void add(Real real)
          add
 void divide(double val)
          divide
 void divide(Real val)
          divide
 long getLong()
          Return the value as long.
 double getValue()
          Getter for the value
 void multiply(double val)
          multiply
 void multiply(Real val)
          multiply
 void setValue(double d)
          Setter for the value.
 java.lang.String toString()
          Return the value as String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ZERO

public static final Real ZERO
ZERO-Real


MAX_VALUE

public static final Real MAX_VALUE
max-Real

Constructor Detail

Real

public Real(double val)
Creates a new object.

Parameters:
val - init with double-value

Real

public Real(Context context,
            TokenSource source)
     throws InterpreterException
Creates a new object. Scan the TokenSource for a Real.

Parameters:
context - ...
source - the token source
Throws:
InterpreterException - ...

Real

public Real(Real val)
Creates a new object.

Parameters:
val - the value

Real

public Real(float val)
Creates a new object.

Parameters:
val - tha value as float

Real

public Real(long l)
Creates a new object.

Parameters:
l - the value as long

Real

public Real(int i)
Creates a new object.

Parameters:
i - the value as int

Real

public Real(java.lang.String s)
     throws InterpreterException
Creates a new object.

If the string equlas null or empty, the value is set to zero

Parameters:
s - the value as String
Throws:
InterpreterException - if a NumberFormatException is throws
Method Detail

setValue

public void setValue(double d)
Setter for the value.

Parameters:
d - the new value

getValue

public double getValue()
Getter for the value

Returns:
the value

add

public void add(double val)
add

Parameters:
val - the value to add

add

public void add(Real real)
add

Parameters:
real - the value to add

divide

public void divide(double val)
            throws InterpreterException
divide

Parameters:
val - the value to divide
Throws:
InterpreterException - in case of a division by zero

divide

public void divide(Real val)
            throws InterpreterException
divide

Parameters:
val - the value to divide
Throws:
InterpreterException - in case of a division by zero

multiply

public void multiply(double val)
multiply

Parameters:
val - the value to multiply

multiply

public void multiply(Real val)
multiply

Parameters:
val - the value to multiply

getLong

public long getLong()
Return the value as long.

Returns:
the value as long

toString

public java.lang.String toString()
Return the value as String

Returns:
the value as String