de.matthiasmann.twl.utils
Class StateSelect

java.lang.Object
  extended by de.matthiasmann.twl.utils.StateSelect

public class StateSelect
extends java.lang.Object


Field Summary
static StateSelect EMPTY
           
 
Constructor Summary
StateSelect(java.util.Collection<StateExpression> expressions)
           
StateSelect(StateExpression... expressions)
           
 
Method Summary
 int evaluate(AnimationState as)
          Evaluates the expression list.
 StateExpression getExpression(int idx)
          Retrives the specified expression
 int getNumExpressions()
          Returns the number of expressions.
static boolean isUseOptimizer()
           
static void setUseOptimizer(boolean useOptimizer)
          Controls the use of the StateSelectOptimizer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final StateSelect EMPTY
Constructor Detail

StateSelect

public StateSelect(java.util.Collection<StateExpression> expressions)

StateSelect

public StateSelect(StateExpression... expressions)
Method Detail

isUseOptimizer

public static boolean isUseOptimizer()

setUseOptimizer

public static void setUseOptimizer(boolean useOptimizer)
Controls the use of the StateSelectOptimizer.

Parameters:
useOptimizer - true if the StateSelectOptimizer should be used

getNumExpressions

public int getNumExpressions()
Returns the number of expressions.

This is also the return value of evaluate(de.matthiasmann.twl.renderer.AnimationState) when no expression matched.

Returns:
the number of expressions

getExpression

public StateExpression getExpression(int idx)
Retrives the specified expression

Parameters:
idx - the expression index
Returns:
the expression
See Also:
getNumExpressions()

evaluate

public int evaluate(AnimationState as)
Evaluates the expression list.

Parameters:
as - the animation stateor null
Returns:
the index of the first matching expression or getNumExpressions() when no expression matches