|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectai.krr.SyntaxAdaptableSymbol
ai.krr.CharacterSymbol
public class CharacterSymbol
This class implements part of the foundations for symbolic programming in
Java. A CharacterSymbol
consists solely of its char value.
As for the order of CharacterSymbol
s, it is simply defined of
the contained char values.
Constructor Summary | |
---|---|
CharacterSymbol(char c)
This constructor creates a CharacterSymbol for the given char value. |
Method Summary | |
---|---|
char |
charValue()
This function returns the value of this CharacterSymbol as a Java char. |
int |
compareTo(CharacterSymbol charSy)
This function compares this CharacterSymbol to the given CharacterSymbol. |
int |
compareTo(Symbol sy)
This function compares this CharacterSymbol to the given Symbol . |
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. |
int |
hashCode()
This function returns the hash code of this Symbol. |
java.lang.String |
toString()
This function returns a printable representation of this CharacterSymbol which is simply the character as a String. |
Methods inherited from class ai.krr.SyntaxAdaptableSymbol |
---|
isBooleanSymbol, isNamedSymbol, isNumericSymbol, prettyPrint, read, write |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CharacterSymbol(char c)
This constructor creates a CharacterSymbol for the given char value.
c
- the char value of this symbolMethod Detail |
---|
public int getClassOrderIndex()
This function returns the index used for ordering Symbols across different classes. This index of this class is defined to be 80.
public int compareTo(Symbol sy)
This function compares this CharacterSymbol to the given Symbol
.
BooleanSymbol
s and NumericSymbol
s are considered to come
before CharacterSymbols in the order defined here. All other types of
Symbols are considered to come after CharacterSymbols.
sy
- the Symbol to which this CharacterSymbol is to be compared
public final char charValue()
This function returns the value of this CharacterSymbol as a Java char.
public int compareTo(CharacterSymbol charSy)
This function compares this CharacterSymbol to the given CharacterSymbol. Two CharacterSymbols are compared by value.
charSy
- the CharacterSymbol to which this CharacterSymbol is
compared
public boolean equals(java.lang.Object obj)
This function tests whether this and the given Object are equal. Two CharacterSymbols are equal if the contain the same value.
equals
in class java.lang.Object
obj
- the Object this should be compared to
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 CharacterSymbol which is simply the character as a String.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |