|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectai.krr.SyntaxAdaptableSymbol
ai.krr.NumericSymbol
ai.krr.RealNumberSymbol
public class RealNumberSymbol
This class implements part of the foundations for symbolic programming in
Java. A RealNumberSymbol
consists solely of its double value.
The order between all NumericSymbol
s, i.e. IntegerSymbol
s and
RealNumberSymbol
s, in defined as the order of their values.
Thus, an IntegerSymbol
can come before or after a
RealNumberSymbol
.
Constructor Summary | |
---|---|
RealNumberSymbol(double val)
This constructor creates a new RealNumberSymbol with the given value. |
Method Summary | |
---|---|
int |
compareTo(NumericSymbol numSy)
This function compares this RealNumberSymbol to the given NumericSymbol . |
double |
doubleValue()
This function returns the value of this RealNumberSymbol as a Java double. |
int |
hashCode()
This function returns the hash code of this Symbol. |
long |
intValue()
This function returns the value of this RealNumberSymbol as a Java (approximate) long. |
java.lang.String |
toString()
This function returns a printable representation of this RealNumberSymbol which is the value (a double) of this NumericSymbol. |
Methods inherited from class ai.krr.NumericSymbol |
---|
compareTo, equals, getClassOrderIndex, isNumericSymbol |
Methods inherited from class ai.krr.SyntaxAdaptableSymbol |
---|
isBooleanSymbol, isNamedSymbol, prettyPrint, read, write |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RealNumberSymbol(double val)
This constructor creates a new RealNumberSymbol with the given value.
val
- the numeric value of this symbolMethod Detail |
---|
public final long intValue()
This function returns the value of this RealNumberSymbol as a Java (approximate) long. This is done using ordinary casting.
intValue
in class NumericSymbol
public final double doubleValue()
This function returns the value of this RealNumberSymbol as a Java double.
doubleValue
in class NumericSymbol
public int compareTo(NumericSymbol numSy)
This function compares this RealNumberSymbol to the given
NumericSymbol
. Two NumericSymbols are compared by value.
compareTo
in class NumericSymbol
numSy
- the NumericSymbol to which this RealNumberSymbol is compared
public final int hashCode()
This function returns the hash code of this Symbol.
hashCode
in class java.lang.Object
public java.lang.String toString()
This function returns a printable representation of this RealNumberSymbol which is the value (a double) of this NumericSymbol.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |