|
JTP API Documentation | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--jtp.fol.Symbol
A constant atomic symbol. This could be a predicate, or an object in the knowledge base. The name of the symbol is in the variable value, inherited from Constant. There should be only one Symbol per name, which is ensured by the pseudo-Constructor function newSymbol.
newSymbol(java.lang.String, java.lang.String),
Serialized Form| Method Summary | |
Object |
clone()
returns this object, since the class is immutable. |
int |
compareTo(Object o)
compares two Symbols. |
boolean |
equals(Object o)
tests if two symbols are equal. |
String |
getName()
|
String |
getPackage()
|
static Symbol |
getSymbol(String s,
String pkg)
finds a symbol with specified name.in the symbol table. |
int |
hashCode()
|
static Symbol |
newSymbol(String s)
|
static Symbol |
newSymbol(String s,
String pkg)
the right way to create a symbol. |
String |
toString()
prints the symbol to string |
static Symbol |
uniqueSymbol(String prefix,
String pkg)
|
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
public String getName()
public String getPackage()
public static Symbol newSymbol(String s,
String pkg)
s - the name of the new symbol. It should be in lower case.
public static Symbol uniqueSymbol(String prefix,
String pkg)
public static Symbol newSymbol(String s)
public static Symbol getSymbol(String s,
String pkg)
s - the name of the symbol
null otherwise.public String toString()
toString in class Objectpublic boolean equals(Object o)
== test on the name strings;
this should work only if both symbols were created in the same symbol table!
equals in class Objecto - the object to match
true if the target object is a symbol, and its name (aka value)
is the same (physically) string as the value of this symbol.public int compareTo(Object o)
compareTo in interface Comparableo - the Symbol to compare with.
o,
a negative if it's less, a zero if they are equal.
ClassCastException - if o is not an Symbolpublic int hashCode()
hashCode in class Objectpublic Object clone()
clone in class Object
|
JTP API Documentation | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||