de.dante.extex.interpreter.expression
Interface EType

All Known Implementing Classes:
Accumulator, TBoolean, TCount, TDouble, TGlue

public interface EType

This interface describes the data type of an expression type.

Version:
$Revision: 1.1 $
Author:
Gerd Neugebauer

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.
 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.
 

Method Detail

add

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

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

and

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

Parameters:
t - the terminal to build the conjunction with
Returns:
the result of the operation
Throws:
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation

divide

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

Parameters:
t - the terminal to divide by
Returns:
the result of the operation
Throws:
ArithmeticOverflowException - in case of a division by zero
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation

eq

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

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

ge

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

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

gt

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

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

le

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

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

lt

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

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

multiply

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

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

ne

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

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

negate

public EType negate()
             throws UnsupportedException
Apply the unary minus - on the current instance.

Returns:
the result of the operation
Throws:
UnsupportedException - in case of an unsupported operation

not

public EType not()
          throws UnsupportedException
Apply the unary negation ! on the current instance.

Returns:
the result of the operation
Throws:
UnsupportedException - in case of an unsupported operation

or

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

Parameters:
t - the terminal to build the disjunction with
Returns:
the result of the operation
Throws:
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation

set

public EType set(EType t)
          throws CastException
Assign a new value from an additional argument. The argument is casted into the proper type.

Parameters:
t - the terminal to build the conjunction with
Returns:
the result of the operation
Throws:
CastException - in case of an error in casing the argument

subtract

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

Parameters:
t - the terminal to subtract
Returns:
the result of the operation
Throws:
CastException - in case of an error in casing the argument
UnsupportedException - in case of an unsupported operation