|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectJSHOP2.CompileTimeObject
JSHOP2.Term
JSHOP2.TermNumber
public class TermNumber
Each numerical term both at compile time and at run time, is an instance of this class.
Field Summary | |
---|---|
private double |
number
The value of the numerical term. |
Fields inherited from class JSHOP2.CompileTimeObject |
---|
endl |
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 JSHOP2.Term |
---|
isNil, merge, merge, print |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private double number
Constructor Detail |
---|
public TermNumber(double numberIn)
numberIn
- the value this numerical term is set to have.Method Detail |
---|
public Term bind(Term[] binding)
bind
in class Term
binding
- an array of terms, indexed by the integers associated with
variable symbols.
public boolean equals(Term t)
equals
in class Term
t
- the term being compared to this term.
true
if the two terms are equal, false
otherwise.public boolean findUnifier(Term t, Term[] binding)
findUnifier
in class Term
t
- the term with which we are finding a unifier.binding
- the unifier to be returned.
false
if the two terms can not be unified,
true
otherwise.public double getNumber()
public boolean isGround()
true
because a numerical term
is always ground by definition.
isGround
in class Term
true
if this term is ground, false
otherwise.public java.lang.String toCode()
toCode
in class CompileTimeObject
String
.public java.lang.String toString()
String
representation of the value
of this numerical term.
toString
in class Term
String
that shows the value of this
term.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |