|
||||||||||
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.IntegerSymbol
public class IntegerSymbol
This class implements part of the foundations for symbolic programming in
Java. An IntegerSymbol
consists solely of its integer value,
which is actually a Java long.
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 | |
---|---|
IntegerSymbol(long val)
This constructor creates a new IntegerSymbol with the given value. |
Method Summary | |
---|---|
int |
compareTo(IntegerSymbol numSy)
This function compares this IntegerSymbol to the given IntegerSymbol. |
int |
compareTo(NumericSymbol numSy)
This function compares this IntegerSymbol to the given NumericSymbol . |
double |
doubleValue()
This function returns the value of this IntegerSymbol as a Java double. |
int |
hashCode()
This function returns the hash code of this Symbol. |
long |
intValue()
This function returns the value of this IntegerSymbol as a Java long. |
java.lang.String |
toString()
This function returns a printable representation of this IntegerSymbol which is the value (a long) 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 IntegerSymbol(long val)
This constructor creates a new IntegerSymbol with the given value.
val
- the numeric value of this symbolMethod Detail |
---|
public final long intValue()
This function returns the value of this IntegerSymbol as a Java long.
intValue
in class NumericSymbol
public final double doubleValue()
This function returns the value of this IntegerSymbol as a Java double.
doubleValue
in class NumericSymbol
public int compareTo(NumericSymbol numSy)
This function compares this IntegerSymbol to the given
NumericSymbol
. Two NumericSymbols are compared by value.
compareTo
in class NumericSymbol
numSy
- the NumericSymbol to which this IntegerSymbol is compared
public int compareTo(IntegerSymbol numSy)
This function compares this IntegerSymbol to the given IntegerSymbol. Two IntegerSymbol are compared by value.
numSy
- the IntegerSymbol to which this IntegerSymbol 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 IntegerSymbol which is the value (a long) 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 |