com.googlecode.jinahya.util.fsm
Class State

java.lang.Object
  extended by com.googlecode.jinahya.util.fsm.State
All Implemented Interfaces:
Serializable

public class State
extends Object
implements Serializable

State of a machine.

Author:
Jin Kwon
See Also:
Serialized Form

Field Summary
static State INVALID
          Constant for INVALID state.
static State UNKNOWN
          Default state for all newly created machines.
 
Constructor Summary
State(int code, String name)
          Creates a new instance.
 
Method Summary
 boolean equals(Object obj)
           
 int getCode()
          Returns code.
 String getName()
          Returns name.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN

public static final State UNKNOWN
Default state for all newly created machines.


INVALID

public static final State INVALID
Constant for INVALID state.

Constructor Detail

State

public State(int code,
             String name)
Creates a new instance.

Parameters:
code - state value; must be a non-zero positive
name - state name; must not be null
Method Detail

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getCode

public final int getCode()
Returns code.

Returns:
code

getName

public final String getName()
Returns name.

Returns:
name


Copyright © 2011. All Rights Reserved.