org.jscience.computing.ai.planning
Class TermList

java.lang.Object
  extended by org.jscience.computing.ai.planning.CompileTimeObject
      extended by org.jscience.computing.ai.planning.Term
          extended by org.jscience.computing.ai.planning.TermList

public class TermList
extends Term

Each list both at compile time and at run time, is an instance of this class.


Field Summary
static TermList NIL
          The NIL term.
 
Constructor Summary
TermList(List listIn)
          To initialize this list term.
TermList(Term headIn, Term tailIn)
          To initialize this list term.
 
Method Summary
 Term bind(Term[] binding)
          To apply a given binding to the list this term represents.
 boolean equals(Term t)
          Whether or not another term is equivalent to this list term.
 boolean findUnifier(Term t, Term[] binding)
          Find a unifier between this list and another given term.
 List getList()
          To get the list this term represents.
 boolean isGround()
          Whether or not there are any variables in the list this term represents.
 java.lang.String toCode()
          This function produces Java code to create this list term.
 Predicate toPredicate(int varCount)
          This function converts this list term to a predicate.
 java.lang.String toString()
          This function is used to print this list term.
 
Methods inherited from class org.jscience.computing.ai.planning.Term
isNil, merge, merge, print
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NIL

public static TermList NIL
The NIL term.

Constructor Detail

TermList

public TermList(List listIn)
To initialize this list term.

Parameters:
listIn - the list this term represents.

TermList

public TermList(Term headIn,
                Term tailIn)
To initialize this list term.

Parameters:
headIn - the head of the list this term represents.
tailIn - the tail of the list this term represents.
Method Detail

bind

public Term bind(Term[] binding)
To apply a given binding to the list this term represents.

Specified by:
bind in class Term
Parameters:
binding - DOCUMENT ME!
Returns:
DOCUMENT ME!

equals

public boolean equals(Term t)
Whether or not another term is equivalent to this list term.

Specified by:
equals in class Term
Parameters:
t - DOCUMENT ME!
Returns:
DOCUMENT ME!

findUnifier

public boolean findUnifier(Term t,
                           Term[] binding)
Find a unifier between this list and another given term.

Specified by:
findUnifier in class Term
Parameters:
t - DOCUMENT ME!
binding - DOCUMENT ME!
Returns:
DOCUMENT ME!

getList

public List getList()
To get the list this term represents.

Returns:
the list this term represnts.

isGround

public boolean isGround()
Whether or not there are any variables in the list this term represents.

Specified by:
isGround in class Term
Returns:
DOCUMENT ME!

toCode

public java.lang.String toCode()
This function produces Java code to create this list term.

Specified by:
toCode in class CompileTimeObject
Returns:
DOCUMENT ME!

toPredicate

public Predicate toPredicate(int varCount)
This function converts this list term to a predicate.

Parameters:
varCount - number of variables in the resulting predicate.
Returns:
the resulting predicate.

toString

public java.lang.String toString()
This function is used to print this list term.

Specified by:
toString in class Term
Returns:
DOCUMENT ME!