de.dante.extex.interpreter.expression.term
Class Accumulator

java.lang.Object
  extended byde.dante.extex.interpreter.expression.term.Accumulator
All Implemented Interfaces:
EType

public class Accumulator
extends java.lang.Object
implements EType

This data type contains an accumulator which can contain values of different kinds.

Version:
$Revision: 1.1 $
Author:
Gerd Neugebauer

Constructor Summary
Accumulator()
          Creates a new object.
 
Method Summary
 EType add(EType t)
          Apply the operation + on the current instance and an additional argument.
 EType and(EType t)
          Apply the operation && on the current instance and an additional argument.
 EType divide(EType t)
          Apply the operation + on the current instance and an additional argument.
 TBoolean eq(EType t)
          Compare the current instance with an another value for equality.
 TBoolean ge(EType t)
          Compare the current instance with an another value for greater or equal.
 EType getValue()
          Getter for value.
 TBoolean gt(EType t)
          Compare the current instance with an another value for greater than.
 TBoolean le(EType t)
          Compare the current instance with an another value for less or equal.
 TBoolean lt(EType t)
          Compare the current instance with an another value for less.
 EType multiply(EType t)
          Apply the operation * on the current instance and an additional argument.
 TBoolean ne(EType t)
          Compare the current instance with an another value for not equal.
 EType negate()
          Apply the unary minus - on the current instance.
 EType not()
          Apply the unary negation ! on the current instance.
 EType or(EType t)
          Apply the operation || on the current instance and an additional argument.
 EType set(EType t)
          Assign a new value from an additional argument.
 EType subtract(EType t)
          Apply the operation - on the current instance and an additional argument.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Accumulator

public Accumulator()
Creates a new object.

Method Detail

add

public EType add(EType t)
          throws CastException,
                 UnsupportedException
Description copied from interface: EType
Apply the operation + on the current instance and an additional argument.

Specified by:
add in interface EType
Parameters:
t - the terminal to add
Returns:
the result of the operation
Throws:
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation
See Also:
EType.add( de.dante.extex.interpreter.expression.EType)

and

public EType and(EType t)
          throws CastException,
                 UnsupportedException
Description copied from interface: EType
Apply the operation && on the current instance and an additional argument.

Specified by:
and in interface EType
Parameters:
t - the terminal to build the conjunction with
Returns:
the result of the operation
Throws:
UnsupportedException - in case of an unsupported operation
CastException - in case of an error in casing the argument
See Also:
EType.and( de.dante.extex.interpreter.expression.EType)

divide

public EType divide(EType t)
             throws CastException,
                    UnsupportedException,
                    ArithmeticOverflowException
Description copied from interface: EType
Apply the operation + on the current instance and an additional argument.

Specified by:
divide in interface EType
Parameters:
t - the terminal to divide by
Returns:
the result of the operation
Throws:
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation
ArithmeticOverflowException - in case of a division by zero
See Also:
EType.divide( de.dante.extex.interpreter.expression.EType)

eq

public TBoolean eq(EType t)
            throws CastException,
                   UnsupportedException
Description copied from interface: EType
Compare the current instance with an another value for equality.

Specified by:
eq in interface EType
Parameters:
t - the terminal to compare to
Returns:
the result of the comparison
Throws:
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation
See Also:
EType.eq( de.dante.extex.interpreter.expression.EType)

ge

public TBoolean ge(EType t)
            throws CastException,
                   UnsupportedException
Description copied from interface: EType
Compare the current instance with an another value for greater or equal.

Specified by:
ge in interface EType
Parameters:
t - the terminal to compare to
Returns:
the result of the comparison
Throws:
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation
See Also:
EType.ge( de.dante.extex.interpreter.expression.EType)

getValue

public EType getValue()
Getter for value.

Returns:
the value

gt

public TBoolean gt(EType t)
            throws CastException,
                   UnsupportedException
Description copied from interface: EType
Compare the current instance with an another value for greater than.

Specified by:
gt in interface EType
Parameters:
t - the terminal to compare to
Returns:
the result of the comparison
Throws:
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation
See Also:
EType.gt( de.dante.extex.interpreter.expression.EType)

le

public TBoolean le(EType t)
            throws CastException,
                   UnsupportedException
Description copied from interface: EType
Compare the current instance with an another value for less or equal.

Specified by:
le in interface EType
Parameters:
t - the terminal to compare to
Returns:
the result of the comparison
Throws:
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation
See Also:
EType.le( de.dante.extex.interpreter.expression.EType)

lt

public TBoolean lt(EType t)
            throws CastException,
                   UnsupportedException
Description copied from interface: EType
Compare the current instance with an another value for less.

Specified by:
lt in interface EType
Parameters:
t - the terminal to compare to
Returns:
the result of the comparison
Throws:
UnsupportedException - in case of an unsupported operation
CastException - in case of an error in casing the argument
See Also:
EType.lt( de.dante.extex.interpreter.expression.EType)

multiply

public EType multiply(EType t)
               throws CastException,
                      UnsupportedException
Description copied from interface: EType
Apply the operation * on the current instance and an additional argument.

Specified by:
multiply in interface EType
Parameters:
t - the terminal to multiply
Returns:
the result of the operation
Throws:
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation
See Also:
EType.multiply( de.dante.extex.interpreter.expression.EType)

ne

public TBoolean ne(EType t)
            throws CastException,
                   UnsupportedException
Description copied from interface: EType
Compare the current instance with an another value for not equal.

Specified by:
ne in interface EType
Parameters:
t - the terminal to compare to
Returns:
the result of the comparison
Throws:
UnsupportedException - in case of an unsupported operation
CastException - in case of an error in casing the argument
See Also:
EType.ne( de.dante.extex.interpreter.expression.EType)

negate

public EType negate()
             throws UnsupportedException
Description copied from interface: EType
Apply the unary minus - on the current instance.

Specified by:
negate in interface EType
Returns:
the result of the operation
Throws:
UnsupportedException - in case of an unsupported operation
See Also:
EType.negate()

not

public EType not()
Description copied from interface: EType
Apply the unary negation ! on the current instance.

Specified by:
not in interface EType
Returns:
the result of the operation
See Also:
EType.not()

or

public EType or(EType t)
         throws CastException,
                UnsupportedException
Description copied from interface: EType
Apply the operation || on the current instance and an additional argument.

Specified by:
or in interface EType
Parameters:
t - the terminal to build the disjunction with
Returns:
the result of the operation
Throws:
UnsupportedException - in case of an unsupported operation
CastException - in case of an error in casing the argument
See Also:
EType.or( de.dante.extex.interpreter.expression.EType)

set

public EType set(EType t)
Description copied from interface: EType
Assign a new value from an additional argument. The argument is casted into the proper type.

Specified by:
set in interface EType
Parameters:
t - the terminal to build the conjunction with
Returns:
the result of the operation
See Also:
EType.set( de.dante.extex.interpreter.expression.EType)

subtract

public EType subtract(EType t)
               throws CastException,
                      UnsupportedException
Description copied from interface: EType
Apply the operation - on the current instance and an additional argument.

Specified by:
subtract in interface EType
Parameters:
t - the terminal to subtract
Returns:
the result of the operation
Throws:
UnsupportedException - in case of an unsupported operation
CastException - in case of an error in casing the argument
See Also:
EType.subtract( de.dante.extex.interpreter.expression.EType)

toString

public java.lang.String toString()
See Also:
Object.toString()