|
ESC/Java2 © 2003,2004,2005,2006 David Cok and Joseph Kiniry © 2005,2006 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectescjava.prover.SExp
escjava.prover.Atom
Atoms are S-expressions representing symbols.
Interned Strings are used to represent symbols.
Accordingly, two Atoms are equal (via ==)
iff they represent the same symbol.
| Field Summary | |
private static java.util.Hashtable |
map
Our map from interned Strings to already created
non-null Atoms. |
static java.lang.String |
special
The list of special symbols that don't need to be quoted when by themselves. |
private java.lang.String |
value
The symbol we represent; always already interned. |
| Constructor Summary | |
private |
Atom(java.lang.String symbol)
Create an Atom representing a given
symbol. |
| Method Summary | |
boolean |
equals(java.lang.Object o)
Return true if this atom and object o are the same atom. |
static Atom |
fromString(java.lang.String symbol)
Create a Atom representing a given symbol. |
Atom |
getAtom()
If we represent an atom, return it as an Atom; otherwise,
throw SExpTypeError. |
boolean |
isAtom()
Do we represent an atom? |
static void |
main(java.lang.String[] args)
A simple test routine |
void |
prettyPrint(java.io.PrintStream out)
Pretty print a textual representation of us on a given PrintStream. |
void |
print(java.io.PrintStream out)
Print a textual representation of us on a given PrintStream. |
static java.lang.String |
printableVersion(java.lang.String symbol)
Returns the printable version (e.g., with escape codes added as needed) of an S-expression symbol's name. |
java.lang.String |
toString()
Return the interned String for the symbol we
represent. |
| Methods inherited from class escjava.prover.SExp |
display, fancyMake, getInteger, getList, isInteger, isList, make, print |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static java.util.Hashtable map
Strings to already created
non-null Atoms.
private java.lang.String value
public static final java.lang.String special
| Constructor Detail |
private Atom(java.lang.String symbol)
Atom representing a given
symbol. Clients are allowed to create
Atoms only by calling fromString so we can
intern.
Precondition: symbol must already have been
interned.
| Method Detail |
public static Atom fromString(java.lang.String symbol)
Atom representing a given symbol.
This function always returns the same Atom when
called on equal Strings.
public boolean isAtom()
isAtom in class SExppublic Atom getAtom()
Atom; otherwise,
throw SExpTypeError.
getAtom in class SExppublic java.lang.String toString()
String for the symbol we
represent.
toString in class SExppublic boolean equals(java.lang.Object o)
public static java.lang.String printableVersion(java.lang.String symbol)
public void print(java.io.PrintStream out)
PrintStream.
Note: This routine will take a PrintWriter instead
when we switch to a more recent version of JDK.
print in class SExppublic void prettyPrint(java.io.PrintStream out)
PrintStream.
Note: This routine will take a PrintWriter instead
when we switch to a more recent version of JDK.
prettyPrint in class SExppublic static void main(java.lang.String[] args)
|
ESC/Java2 © 2003,2004,2005,2006 David Cok and Joseph Kiniry © 2005,2006 UCD Dublin © 2003,2004 Radboud University Nijmegen © 1999,2000 Compaq Computer Corporation © 1997,1998,1999 Digital Equipment Corporation All Rights Reserved |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||