|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.util.CloneableObject
org.jboss.util.state.State
Provides the basic interface for states (both accepting, acceptable and final) of a state machine.
Each state is immutable and has a name and integer value. States are considered equivilent if the integer values equal.
Note that the second opperand is an annonymous class, changing its equivilence from a vanilla Type instance.
State objects also can contain an optional opaque object. This is provided for applications to make use of the state machine for managing data assocciated with the state.
Nested Class Summary |
Nested classes inherited from class org.jboss.util.CloneableObject |
CloneableObject.Cloneable |
Field Summary | |
String |
name
The human readable name of the state. |
protected Object |
opaque
The optional opaque user data for the state. |
int |
value
The integer value of the state. |
Constructor Summary | |
State(int value)
|
|
State(int value,
String name)
|
Method Summary | |
boolean |
equals(Object obj)
Check for state equality. |
String |
getName()
Returns the name of the state, or if null returns the integer value as a string. |
Object |
getOpaque()
|
int |
getValue()
|
int |
hashCode()
Returns the has code of the object. |
void |
setOpaque(Object obj)
|
String |
toIdentityString()
Returns the identity string of this state. |
String |
toString()
|
Methods inherited from class org.jboss.util.CloneableObject |
clone |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public final int value
States with the same value are equal.
public final String name
protected Object opaque
Constructor Detail |
public State(int value, String name)
public State(int value)
Method Detail |
public int getValue()
public String getName()
public void setOpaque(Object obj)
public Object getOpaque()
public String toString()
public String toIdentityString()
This is the same value returned by Object.toString()
.
public int hashCode()
public boolean equals(Object obj)
States are considered equal if the integer values of the State objects are equivilent.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |