|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmodel.logic.Clause
public class Clause
This class represents the clause logic object. Basically, a clause is a set of literals. A clause has an unique id.
Constructor Summary | |
---|---|
Clause(java.util.List<Literal> literals,
long id)
Initializes a clause from a list of literals and an id |
|
Clause(long id)
Initializes a clause from an id |
|
Clause(long id,
java.lang.String s,
java.util.List<Variable> variables)
Initializes a clause from an id, a string ans a list of atoms. |
Method Summary | |
---|---|
void |
addLitteral(Literal l)
Adds a new literal to the clause |
int |
compareTo(Clause o)
|
long |
getId()
Returns the id of the clause |
java.util.List<Literal> |
getLiterals()
Returns literals of the clause |
int |
getNumberOfLiterals()
Returns the number of literals composing the clause |
void |
setId(long id)
Assigns a new id to the clause |
void |
setLiterals(java.util.List<Literal> literals)
Assign a set of literals to the clause |
java.lang.String |
toLongString()
Returns a detailed representation of the clause |
java.lang.String |
toModifiableString()
Returns the clause under the form "l1, l2,... ln" |
java.lang.String |
toString()
|
static java.lang.String |
toStringWithIndexes(java.lang.String stringBase,
int indiceSouhaite)
Returns the string "stringBase + indiceSouhaite" |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Clause(java.util.List<Literal> literals, long id)
literals
- : the list of clauses composing the clauseid
- : id of the clausepublic Clause(long id)
id
- : id of the clausepublic Clause(long id, java.lang.String s, java.util.List<Variable> variables)
id
- : id of the clauses
- : string representing the clausevariables
- : set of variables that are used in the string sMethod Detail |
---|
public java.util.List<Literal> getLiterals()
public void setLiterals(java.util.List<Literal> literals)
literals
- : the new set of literalspublic void addLitteral(Literal l)
l
- : the new literal to addpublic int getNumberOfLiterals()
public long getId()
public void setId(long id)
id
- : the new id to assignpublic java.lang.String toLongString()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toModifiableString()
public int compareTo(Clause o)
compareTo
in interface java.lang.Comparable<Clause>
public static java.lang.String toStringWithIndexes(java.lang.String stringBase, int indiceSouhaite)
stringBase
- : base of the stringindiceSouhaite
- : number that should appear as index of the clause
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |