|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.mit.csail.sdg.alloy4compiler.sim.SimAtom
public final class SimAtom
Immutable; represents an atom.
Outside of this class, we guarantee for any SimAtom x and y, then "x.equals(y) iff x==y".
Even though that means "equals()" and "==" are equivalent,
the equals() method is much slower than "==" for SimAtom,
so you should always try to use "==" on SimAtom.
Thread Safety: Safe.
| Field Summary | |
|---|---|
static SimAtom |
EMPTYSTRING
Preconstructed atom representing emptystring. |
static SimAtom |
ONE
Preconstructed atom representing 1. |
static SimAtom |
ZERO
Preconstructed atom representing 0. |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object that)
|
int |
hashCode()
|
static SimAtom |
make(int i)
Construct a SimAtom for the given integer, or if an existing SimAtom hasn't been garbage collected yet then return that instead. |
static SimAtom |
make(long i)
Construct a SimAtom for the given integer, or if an existing SimAtom hasn't been garbage collected yet then return that instead. |
static SimAtom |
make(java.lang.String label)
Construct a SimAtom for the given label, or if an existing SimAtom hasn't been garbage collected yet then return that instead. |
SimTuple |
product(SimAtom that)
Return the product of this atom and that atom. |
java.lang.Integer |
toInt(java.lang.Integer defaultValue)
If the atom starts with "-" or "0-9" then convert it into a 32-bit int (here we assume that it came from a 32-bit int) |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final SimAtom EMPTYSTRING
public static final SimAtom ZERO
public static final SimAtom ONE
| Method Detail |
|---|
public static SimAtom make(java.lang.String label)
public static SimAtom make(int i)
public static SimAtom make(long i)
public java.lang.Integer toInt(java.lang.Integer defaultValue)
throws java.lang.NumberFormatException
If the atom does not start with "-" or "0-9", then return defaultValue.
java.lang.NumberFormatExceptionpublic SimTuple product(SimAtom that)
public boolean equals(java.lang.Object that)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||