JTP API Documentation

jtp.fol
Class DefaultClause

java.lang.Object
  |
  +--jtp.fol.DefaultClause
All Implemented Interfaces:
Clause, CNFSentence, Serializable, Substitutable

public class DefaultClause
extends Object
implements Clause, Serializable

Default implementation of Clause.

See Also:
Serialized Form

Constructor Summary
DefaultClause(Collection literals)
           
DefaultClause(Literal l1, Literal l2)
           
DefaultClause(Literal l1, Literal l2, Literal l3)
           
 
Method Summary
 Collection clauses()
          Returns the collection of Clauses that make up this CNFSentence.
 boolean equals(Object o)
           
 Collection literals()
          Returns the collection of Literals that make up this Clause.
 Object substitute(Map m)
          Performs substitution in this object.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultClause

public DefaultClause(Collection literals)

DefaultClause

public DefaultClause(Literal l1,
                     Literal l2)

DefaultClause

public DefaultClause(Literal l1,
                     Literal l2,
                     Literal l3)
Method Detail

literals

public Collection literals()
Description copied from interface: Clause
Returns the collection of Literals that make up this Clause.

Specified by:
literals in interface Clause
Returns:
a Collection of Literals

clauses

public Collection clauses()
Description copied from interface: CNFSentence
Returns the collection of Clauses that make up this CNFSentence.

Specified by:
clauses in interface CNFSentence
Returns:
a Collection of Clauses

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

substitute

public Object substitute(Map m)
Description copied from interface: Substitutable
Performs substitution in this object. Specifically, this method produces an object derived from this Substitutable, with every occurrence of each key in the supplied map replaced by the corresponding value. This method shouldn't modify the original Substitutable, but rather construct a new instance, if changes are necessary. If this Substitutable does not contain any of the keys in the map, the method can and should return this.

Note that this method does not have to check if this object is itself a key in the substitution map and therefore has to be replaced. If you need that functionality, SubstUtils.substitute(Object, Map) should be used instead.

Specified by:
substitute in interface Substitutable
Returns:
the result of the substitution

JTP API Documentation