net.groboclown.util.states.v1
Class StateCategory

java.lang.Object
  |
  +--net.groboclown.util.states.v1.StateCategory

public class StateCategory
extends Object

Creates new categories for State collections. Does not save the created state objects. To save time, this creates both States and Transitions, though it should only be used for one or the other.

Version:
0.9.0 Alpha
Author:
Matt Albrecht

Field Summary
private  int category
           
private static int categoryNum
           
private  Object m_sync
           
private  int maxStates
           
private  int stateNum
           
private static Object sync
           
 
Constructor Summary
StateCategory(int maxStateCount)
          Default Constructor
 
Method Summary
 int getMaximumStateCount()
           
private static int getNextCategoryInt()
           
 State getNextState()
          Creates a new unique State instance for this category.
private  int getNextStateInt()
           
 Transition getNextTransition()
          Creates a new unique Transition instance for this category.
 boolean isOfCategory(State s)
          Checks if the given state is of this category.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

sync

private static final Object sync

categoryNum

private static int categoryNum

category

private int category

stateNum

private int stateNum

maxStates

private int maxStates

m_sync

private final Object m_sync
Constructor Detail

StateCategory

public StateCategory(int maxStateCount)
Default Constructor
Method Detail

getNextState

public State getNextState()
Creates a new unique State instance for this category.

getNextTransition

public Transition getNextTransition()
Creates a new unique Transition instance for this category.

isOfCategory

public boolean isOfCategory(State s)
Checks if the given state is of this category.

getMaximumStateCount

public int getMaximumStateCount()

getNextStateInt

private final int getNextStateInt()

getNextCategoryInt

private static final int getNextCategoryInt()


Written under the LGPL