se.sics.jasper
Class SPCanonicalAtom
java.lang.Object
|
+--se.sics.jasper.SPCanonicalAtom
- public class SPCanonicalAtom
- extends java.lang.Object
The SPCanonicalAtom class encapsulates the canonical representation of
a Prolog atom, which is usually a 32 or 64-bit integer. In previous
versions of Jasper, atoms were passed around as Java long
types. However, this prevented interaction with the atom garbage
collector. By using this class instead, atoms only referenced
canonically from Java are ensured not to be garbage collected.
You should not inherit from SPCanonicalAtom
.
- See Also:
SPTerm.getCanonicalAtom()
Constructor Summary |
SPCanonicalAtom(SICStus sp,
java.lang.String string)
Create a canonical atom from a string. |
Method Summary |
boolean |
isSameAtom(SPCanonicalAtom cAtom)
Returns true iff the atoms have the same canonical representation. |
java.lang.String |
toString()
Return this canonical atom as a string |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
SPCanonicalAtom
public SPCanonicalAtom(SICStus sp,
java.lang.String string)
throws AtomRegisterFailure
- Create a canonical atom from a string.
toString
public java.lang.String toString()
- Return this canonical atom as a string
- Overrides:
- toString in class java.lang.Object
isSameAtom
public boolean isSameAtom(SPCanonicalAtom cAtom)
throws IllegalTermException
- Returns true iff the atoms have the same canonical representation.