org.jscience.computing.ai.planning
Class TermVariable

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.TermVariable

public class TermVariable
extends Term

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


Constructor Summary
TermVariable(int indexIn)
          To initialize this variable symbol.
 
Method Summary
 Term bind(Term[] binding)
          Since this term is a variable symbol, binding it basically means finding out whether or not this variable is already mapped to something in the input, and if so, returning the value this variable is mapped to.
 boolean equals(Term t)
          This function returns false.
 boolean findUnifier(Term t, Term[] binding)
          Find a unifier between this variable symbol and another given term.
 int getIndex()
          To get the index for this variable symbol.
static TermVariable getVariable(int index)
          To return the correponding existing variable symbol.
static void initialize(int size)
          To initialize an array of variable symbols that we know occur in the domain description, so that there will be no duplicate copies of those symbols.
 boolean isGround()
          This function always returns false because a variable symbol is never ground by definition.
 java.lang.String toCode()
          This function produces Java code to create this variable symbol as a term.
 java.lang.String toString()
          This function is used to print this variable symbol.
 
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
 

Constructor Detail

TermVariable

public TermVariable(int indexIn)
To initialize this variable symbol.

Parameters:
indexIn - the integer associated with this variable symbol.
Method Detail

bind

public Term bind(Term[] binding)
Since this term is a variable symbol, binding it basically means finding out whether or not this variable is already mapped to something in the input, and if so, returning the value this variable is mapped to.

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

equals

public boolean equals(Term t)
This function returns false.

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 variable symbol and another given term.

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

getIndex

public int getIndex()
To get the index for this variable symbol.

Returns:
the integer associated with this variable symobl.

getVariable

public static TermVariable getVariable(int index)
To return the correponding existing variable symbol.

Parameters:
index - the index of the variable symbol to be returned.
Returns:
the corresponding existing variable symbol.

initialize

public static void initialize(int size)
To initialize an array of variable symbols that we know occur in the domain description, so that there will be no duplicate copies of those symbols. In other words, all variable symbols that represent the same thing in different places point to the corresponding element in this array at run time.

Parameters:
size - the number of existing variable symbols.

isGround

public boolean isGround()
This function always returns false because a variable symbol is never ground by definition.

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

toCode

public java.lang.String toCode()
This function produces Java code to create this variable symbol as a term.

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

toString

public java.lang.String toString()
This function is used to print this variable symbol.

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