Raptor.LogicParser.Formula.AExp
Class AExp

java.lang.Object
  extended by Raptor.LogicParser.Formula.Term
      extended by Raptor.LogicParser.Formula.AExp.AExp
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class AExp
extends Term

Abstract class for arithmetic expressions.

See Also:
Serialized Form

Field Summary
 Term left
           
 java.lang.String op
           
 Term right
           
 
Constructor Summary
AExp(Term pLeft, Term pRight, java.lang.String pOp)
          Create a new arithmetic expression
 
Method Summary
 void addToSignature(PanSignature pSignature)
          This method adds this Term to the passed PanSignature IF it is not already in the signature.
 java.lang.String clashes(PanSignature pSignature)
          Returns a String of error message if this Term clashes with the passed PanSignature.
A Term clashes with a PanSignature if it clashes with any of its Predicates,Constants,Functions or Variables.
If this Term does not clash with the Signature, it is added to the signature and an empty String is returned.
 Term clone()
          Returns a copy(clone) of this Term.
 java.lang.String display()
          Returns a String to display the AExp.
 Term getLeft()
          Returns the left hand side of the arithmetic expression.
 java.lang.String getName()
          Returns the name of the expression.
 java.lang.String getOp()
          Returns the Operator of the expression.
 Term getRight()
          Returns the right hand side of the arithmetic expression.
 boolean isIn(PanSignature pSignature)
          Returns true if this Term is in the passed PanSignature.
 void setVars(Var pVar)
          This method adds Var v to the list of variables this Term is bound to.
 Term sub(Term pTermX, Term pTermY)
          Substitutes all the occurrences of Term pTermX by Term pTermY.
 
Methods inherited from class Raptor.LogicParser.Formula.Term
concatNoDup, equals, getVars, isIn, isInVars
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

left

public Term left

right

public Term right

op

public java.lang.String op
Constructor Detail

AExp

public AExp(Term pLeft,
            Term pRight,
            java.lang.String pOp)
Create a new arithmetic expression

Parameters:
pLeft - the left operand of the arithmetic expression
pRight - the right operand of the arithmetic expression
pOp - the operator of the arithmetic expression
Method Detail

display

public java.lang.String display()
Returns a String to display the AExp.

Specified by:
display in class Term

getName

public java.lang.String getName()
Returns the name of the expression.

Specified by:
getName in class Term

getOp

public java.lang.String getOp()
Returns the Operator of the expression.


isIn

public boolean isIn(PanSignature pSignature)
Returns true if this Term is in the passed PanSignature.

Specified by:
isIn in class Term
Parameters:
pSignature - PanSignature represents the signature it is to be searched in.

clashes

public java.lang.String clashes(PanSignature pSignature)
Returns a String of error message if this Term clashes with the passed PanSignature.
A Term clashes with a PanSignature if it clashes with any of its Predicates,Constants,Functions or Variables.
If this Term does not clash with the Signature, it is added to the signature and an empty String is returned.

Specified by:
clashes in class Term
Parameters:
pSignature - PanSignature Represents the signature to be compared against.

clone

public Term clone()
Returns a copy(clone) of this Term.

Specified by:
clone in class Term

getLeft

public Term getLeft()
Returns the left hand side of the arithmetic expression.


getRight

public Term getRight()
Returns the right hand side of the arithmetic expression.


addToSignature

public void addToSignature(PanSignature pSignature)
This method adds this Term to the passed PanSignature IF it is not already in the signature.

Specified by:
addToSignature in class Term
Parameters:
pSignature - PanSignature represents the signature to add this Formula to.

setVars

public void setVars(Var pVar)
This method adds Var v to the list of variables this Term is bound to.

Specified by:
setVars in class Term
Parameters:
pVar - Var represents the Var to be added to the list of this Term's variables.

sub

public Term sub(Term pTermX,
                Term pTermY)
Substitutes all the occurrences of Term pTermX by Term pTermY.

Specified by:
sub in class Term
Parameters:
pTermX - represents the Term to be substituted.
pTermY - the Term to substitute the Term pTermX with.