com.googlecode.jinahya.util.fsm
Class AbstractState

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

public abstract class AbstractState
extends Object
implements State

State of a machine.

Author:
Jin Kwon
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.googlecode.jinahya.util.fsm.State
UNKNOWN
 
Constructor Summary
AbstractState(int code, String name)
          Creates a new instance.
 
Method Summary
 boolean equals(Object obj)
           
 int getCode()
          Returns code.
 String getName()
          Returns name.
 int hashCode()
           
static State newInstance(int code, String name)
          Creates a new State instance.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractState

public AbstractState(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

newInstance

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

Parameters:
code - state code
name - state name
Returns:
a new State instance.

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.

Specified by:
getCode in interface State
Returns:
code

getName

public final String getName()
Returns name.

Specified by:
getName in interface State
Returns:
name


Copyright © 2011. All Rights Reserved.