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

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

public class TBoolean
extends java.lang.Object
implements EType

This class encapsulates a boolean value for the use in the expression evaluator.

Version:
$Revision: 1.1 $
Author:
Gerd Neugebauer

Constructor Summary
TBoolean()
          Creates a new object.
TBoolean(boolean value)
          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.
protected static boolean castTerminal(EType t)
          Cast a terminal to a double.
 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.
 boolean isValue()
          Getter for value.
 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 parse(java.lang.CharSequence sequence)
           
 EType set(EType t)
          Assign a new value from an additional argument.
 void setValue(boolean value)
          Setter for value.
 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

TBoolean

public TBoolean()
Creates a new object.


TBoolean

public TBoolean(boolean value)
Creates a new object.

Parameters:
value - the initial value
Method Detail

castTerminal

protected static boolean castTerminal(EType t)
                               throws CastException
Cast a terminal to a double.

Parameters:
t - the terminal to cast
Returns:
the double encountered
Throws:
CastException - in case of an error

add

public EType add(EType t)
          throws 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:
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
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:
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
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
See Also:
EType.divide( de.dante.extex.interpreter.expression.EType)

eq

public TBoolean eq(EType t)
            throws 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:
UnsupportedException - in case of an unsupported operation
See Also:
EType.eq( de.dante.extex.interpreter.expression.EType)

ge

public TBoolean ge(EType t)
            throws 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:
UnsupportedException - in case of an unsupported operation
See Also:
EType.ge( de.dante.extex.interpreter.expression.EType)

gt

public TBoolean gt(EType t)
            throws 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:
UnsupportedException - in case of an unsupported operation
See Also:
EType.gt( de.dante.extex.interpreter.expression.EType)

isValue

public boolean isValue()
Getter for value.

Returns:
the value

le

public TBoolean le(EType t)
            throws 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:
UnsupportedException - in case of an unsupported operation
See Also:
EType.le( de.dante.extex.interpreter.expression.EType)

lt

public TBoolean lt(EType t)
            throws 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
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 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
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()
          throws UnsupportedException
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
Throws:
UnsupportedException - in case of an unsupported operation
See Also:
EType.not()

or

public EType or(EType t)
         throws CastException
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:
CastException - in case of an error in casing the argument
See Also:
EType.or( de.dante.extex.interpreter.expression.EType)

parse

public EType parse(java.lang.CharSequence sequence)
See Also:
de.dante.extex.interpreter.expression.EType#parse( java.lang.CharSequence)

set

public EType set(EType t)
          throws CastException
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
Throws:
CastException - in case of an error in casing the argument
See Also:
EType.set( de.dante.extex.interpreter.expression.EType)

setValue

public void setValue(boolean value)
Setter for value.

Parameters:
value - the value to set

subtract

public EType subtract(EType t)
               throws 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
See Also:
EType.subtract( de.dante.extex.interpreter.expression.EType)

toString

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