|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlogic.Formula
public abstract class Formula
Formula
This abstract class represents a basic formula. The binary operators AND and OR have to subformulas attaches, the unary operator NOT has one, while the True clause has none.Copyright(c) 2005 Université Laval, LSFM research group.
Field Summary | |
---|---|
protected Formula[] |
subFormula
|
Constructor Summary | |
---|---|
Formula()
Constructor with no subformula, for the True clause. |
|
Formula(Formula subFormula)
Constructor with one subformula, for logical operator NOT. |
|
Formula(Formula subFormula1,
Formula subFormula2)
Constructor with two subformulas, for logical operators AND and NOT. |
Method Summary | |
---|---|
int |
depth()
Current formula's depth. |
boolean |
equals(java.lang.Object o)
Determines if the provided object is a formula equal to this one |
Formula[] |
getSubFormula()
Access the subformula(s) of the current fomula |
abstract java.lang.String |
getType()
This function must be implemented by subclasses |
void |
setSubFormula(Formula[] subFormula)
Sets the current subformulas of this logical operator |
java.lang.String |
toString()
Converting this formula into a string |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Formula[] subFormula
Constructor Detail |
---|
public Formula()
public Formula(Formula subFormula)
subFormula
- the attached subformulapublic Formula(Formula subFormula1, Formula subFormula2)
subFormula1
- the left subformulasubFormula2
- the right subformulaMethod Detail |
---|
public Formula[] getSubFormula()
public void setSubFormula(Formula[] subFormula)
subFormula
- an array of subformulas to attachpublic int depth()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare
public java.lang.String toString()
toString
in class java.lang.Object
public abstract java.lang.String getType()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |