|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPandora.LogicParser.Formula.Term
Pandora.LogicParser.Formula.Var
public class Var
The Var (a Variable)
Extends abstract class Term.
Constructor Summary | |
---|---|
Var(java.lang.String name)
Constructs a Var(A variable) |
Method Summary | |
---|---|
void |
addToSignature(PanSignature signature)
This method adds this Var to the Variable List of the passed PanSignature IF it is not already in the signature. |
boolean |
clashes(Atom a)
Returns true if the passed Atom clashes with this Var An Atom clashes with a Var if they have the same name. |
java.lang.String |
clashes(PanSignature signature)
Returns a String of error message if this Var clashes with the passed PanSignature. A Var clashes with a PanSignature if it clashes with any of its Predicates,Constants,Functions or Variables. If this Var does not clash with the Signature, it is added to the Variable list of the signature and an empty String is returned. |
boolean |
clashes(Term t)
Returns true if the passed Term(Constant/Function/Var) clashes with this Var. A Var clashes with a Term if they have the same name. |
Var |
clone()
Returns a copy(clone) of this Var. |
java.lang.String |
display()
Returns a String to display the Var. |
boolean |
equals(Term x)
Returns true if the passed Term is equal to this Var A Term is equal to a Var if it is a Var and they have the same name. |
java.lang.String |
getName()
Returns the name of the Var. |
boolean |
isIn(PanSignature signature)
Returns true if this Var is in the Variable list of the passed PanSignature |
void |
setVars(Var v)
This method adds Var v to the list of variables this Variable is bound to This will help the parser to prevent having nested variables I.e. |
Term |
sub(Term x,
Term y)
Substitutes all the occurences of Term x by Term y. |
Methods inherited from class Pandora.LogicParser.Formula.Term |
---|
concatNoDup, getVars, isIn, isInVars |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Var(java.lang.String name)
name
- String of the name fo the variableMethod Detail |
---|
public java.lang.String getName()
getName
in class Term
public Term sub(Term x, Term y)
sub
in class Term
x
- represents the Term to be substituted.y
- represents the Term used to substitute the Term xpublic java.lang.String display()
display
in class Term
public boolean equals(Term x)
equals
in class Term
t
- Term represents the Term it is to be compared against.public boolean isIn(PanSignature signature)
isIn
in class Term
signature
- PanSignature represents the signature it is to be searched in.public void setVars(Var v)
setVars
in class Term
v
- Var represents the Var to be added to the list of this Var's variables.public Var clone()
clone
in class Term
public boolean clashes(Atom a)
a
- Atom represents the Atom to be compared against.public boolean clashes(Term t)
t
- Term Represents the Term to be compared against.public java.lang.String clashes(PanSignature signature)
clashes
in class Term
signature
- PanSignature Represents the signature to be compared against.public void addToSignature(PanSignature signature)
addToSignature
in class Term
signature
- PanSignature represents the signature to add this Formula to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |