|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectai.krr.SyntaxAdaptableSymbol
ai.krr.BooleanSymbol
public final class BooleanSymbol
This class implements part of the foundations for symbolic programming in
Java. There are in fact only two BooleanSymbol
s, and these are
defined in this class: TRUE
and FALSE
. Thus, there is no
need to construct BooleanSymbol
s ever and no construction method
is provided.
As for the order of BooleanSymbol
s, it is simply defined that
FALSE precedes TRUE.
Field Summary | |
---|---|
static BooleanSymbol |
FALSE
the BooleanSymbol for FALSE |
static BooleanSymbol |
TRUE
the BooleanSymbol for TRUE |
Method Summary | |
---|---|
boolean |
booleanValue()
This function returns the value of this BooleanSymbol as a Java boolean. |
protected java.lang.Object |
clone()
This class does not support cloning and an Exception will be thrown if this method is called. |
int |
compareTo(BooleanSymbol boolSy)
This function compares this BooleanSymbol to the given BooleanSymbol. |
int |
compareTo(Symbol sy)
This function compares this BooleanSymbol to the given Symbol . |
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. |
boolean |
isBooleanSymbol()
This function tests whether this Symbol is a BooleanSymbol. |
static BooleanSymbol |
not(BooleanSymbol b)
This function returns the negation of the given BooleanSymbol. |
java.lang.String |
toString()
This function returns a printable representation of this BooleanSymbol which is either "TRUE" or "FALSE". |
Methods inherited from class ai.krr.SyntaxAdaptableSymbol |
---|
isNamedSymbol, isNumericSymbol, prettyPrint, read, write |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final BooleanSymbol FALSE
public static final BooleanSymbol TRUE
Method Detail |
---|
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
This class does not support cloning and an Exception will be thrown if this method is called.
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- will be thrownpublic final 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 isBooleanSymbol()
This function tests whether this Symbol
is a BooleanSymbol.
isBooleanSymbol
in interface Symbol
isBooleanSymbol
in class SyntaxAdaptableSymbol
public int compareTo(Symbol sy)
This function compares this BooleanSymbol to the given Symbol
.
The order between different kinds of Symbols is arbitrarily defined as
(ascending): BooleanSymbol, NumericSymbol
,
CharacterSymbol
, StringSymbol
, AnonymousSymbol
,
NamedSymbol
.
sy
- the Symbol to which this Symbol is to be compared
public final boolean booleanValue()
This function returns the value of this BooleanSymbol as a Java boolean.
public int compareTo(BooleanSymbol boolSy)
This function compares this BooleanSymbol to the given BooleanSymbol. In
the order defined here FALSE
comes before TRUE
.
boolSy
- the BooleanSymbol to which this BooleanSymbol 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 BooleanSymbol which is either "TRUE" or "FALSE".
toString
in class java.lang.Object
public static BooleanSymbol not(BooleanSymbol b)
This function returns the negation of the given BooleanSymbol.
b
- the BooleanSymbol to be negated
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |