org.jscience.computing.ai.planning
Class TermNumber

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

public class TermNumber
extends Term

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


Constructor Summary
TermNumber(double numberIn)
          To initialize this numerical term.
 
Method Summary
 Term bind(Term[] binding)
          Since this term is a numerical term, binding will not change it, therefore, simply this numerical term itself is returned.
 boolean equals(Term t)
          Whether or not another term is equivalent to this numerical term.
 boolean findUnifier(Term t, Term[] binding)
          Find a unifier between this numerical term and another given term.
 double getNumber()
          To get the value of this numerical term.
 boolean isGround()
          This function always returns true because a numerical term is always ground by definition.
 java.lang.String toCode()
          This function produces Java code to create this numerical.
 java.lang.String toString()
          This function returns the String representation of the value of this numerical 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
 

Constructor Detail

TermNumber

public TermNumber(double numberIn)
To initialize this numerical term.

Parameters:
numberIn - the value this numerical term is set to have.
Method Detail

bind

public Term bind(Term[] binding)
Since this term is a numerical term, binding will not change it, therefore, simply this numerical term itself is returned.

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 numerical 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 numerical term and another given term. Since this term is a number, this boils down to whether or not the other given term is equal to this one.

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

getNumber

public double getNumber()
To get the value of this numerical term.

Returns:
the value of this numerical term.

isGround

public boolean isGround()
This function always returns true because a numerical term is always 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 numerical.

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

toString

public java.lang.String toString()
This function returns the String representation of the value of this numerical term.

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