|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectai.krr.SyntaxAdaptableSymbol
ai.krr.NumericSymbol
public abstract class NumericSymbol
This class implements part of the foundations for symbolic programming in
Java. A NumericSymbol
consists solely of its numeric value.
The order between all NumericSymbol
s, i.e. IntegerSymbol
s and RealNumberSymbol
s, is defined as the order of their values.
Thus, an IntegerSymbol
can come before or after a
RealNumberSymbol
.
Constructor Summary | |
---|---|
NumericSymbol()
|
Method Summary | |
---|---|
abstract int |
compareTo(NumericSymbol numSy)
This function compares this NumericSymbol to the given NumericSymbol. |
int |
compareTo(Symbol sy)
This function compares this NumericSymbol to the given Symbol . |
abstract double |
doubleValue()
This function returns the value of this NumericSymbol as a Java double. |
boolean |
equals(java.lang.Object obj)
This function tests whether this and the given Object are equal. |
int |
getClassOrderIndex()
This function returns the index used for ordering Symbols across different classes. |
abstract long |
intValue()
This function returns the value of this NumericSymbol as a Java long. |
boolean |
isNumericSymbol()
This function tests whether this Symbol is a NumericSymbol. |
Methods inherited from class ai.krr.SyntaxAdaptableSymbol |
---|
isBooleanSymbol, isNamedSymbol, prettyPrint, read, write |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NumericSymbol()
Method Detail |
---|
public abstract long intValue()
This function returns the value of this NumericSymbol as a Java long.
public abstract double doubleValue()
This function returns the value of this NumericSymbol as a Java double.
public abstract int compareTo(NumericSymbol numSy)
This function compares this NumericSymbol to the given NumericSymbol. Two NumericSymbols are compared by value.
numSy
- the NumericSymbol to which this NumericSymbol is compared
public int getClassOrderIndex()
This function returns the index used for ordering Symbols across different classes. This index of this class is defined to be zero.
public boolean isNumericSymbol()
This function tests whether this Symbol
is a NumericSymbol.
isNumericSymbol
in interface Symbol
isNumericSymbol
in class SyntaxAdaptableSymbol
public int compareTo(Symbol sy)
This function compares this NumericSymbol to the given Symbol
.
Only BooleanSymbols are considered to come before NumericSymbols in the
order defined here. All other types of Symbols are considered to come
after NumericSymbols.
sy
- the Symbol to which this NumericSymbol is to be compared
public boolean equals(java.lang.Object obj)
This function tests whether this and the given Object are equal. Two NumericSymbols are equal if they contain the same value, as int or double.
equals
in class java.lang.Object
obj
- the Object this should be compared to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |