org.jscience.mathematics.analysis.expressions.logical
Interface Logical

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
And, BinaryComparison, EQ, GE, GT, LE, LogicalBinary, LogicalConstant, LogicalParameter, LogicalUnary, LogicalVariable, LT, NEQ, Not, Or, Xor

public interface Logical
extends java.io.Serializable

Interface for creating symbolic logical expressions, which may be evaluated.
Example of use:

 Logical x = new LogicalConstant( true );
 Logical y = new LogicalVariable( "y", true );
 Logical z = new And( x, y );
 boolean value = z.truthValue();

See Also:
LogicalConstant, LogicalVariable, LogicalParameter, LogicalUnary, LogicalBinary

Method Summary
 boolean contains(Expression e)
          Returns true if the Logical contains the Expression e, else returns false;
 Logical optimize()
          Returns a new Logical object that represents the optimized logical expression.
 Logical replace(Expression a, Expression b)
          Replace all occurences of the Expression a in the current expression with the Expression b.
 java.lang.String toJava()
          Returns String object representing Logical in Java source code.
 java.lang.String toString()
          Return a String representation of the Logical expression.
 java.lang.String toXML()
          Returns String object representing Logical in XML code.
 boolean truthValue()
          Returns the truth value of the Logical object.
 

Method Detail

truthValue

boolean truthValue()
Returns the truth value of the Logical object.

Returns:
DOCUMENT ME!

optimize

Logical optimize()
Returns a new Logical object that represents the optimized logical expression.

Returns:
DOCUMENT ME!

replace

Logical replace(Expression a,
                Expression b)
Replace all occurences of the Expression a in the current expression with the Expression b.

Parameters:
a - DOCUMENT ME!
b - DOCUMENT ME!
Returns:
DOCUMENT ME!

contains

boolean contains(Expression e)
Returns true if the Logical contains the Expression e, else returns false;

Parameters:
e - DOCUMENT ME!
Returns:
DOCUMENT ME!

toString

java.lang.String toString()
Return a String representation of the Logical expression.

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

toJava

java.lang.String toJava()
Returns String object representing Logical in Java source code.

Returns:
String object representing Logical in Java source code.

toXML

java.lang.String toXML()
Returns String object representing Logical in XML code.

Returns:
String object representing Logical in XML code.