de.jaetzold.util
Class StateDeciderLinkedStateDecider

java.lang.Object
  |
  +--de.jaetzold.util.LinkedStateDecider
        |
        +--de.jaetzold.util.StateDeciderLinkedStateDecider
All Implemented Interfaces:
StateDecider
Direct Known Subclasses:
FTRotationCountStateDecider

public class StateDeciderLinkedStateDecider
extends LinkedStateDecider


Field Summary
protected  StateDecider linker
           
 
Fields inherited from class de.jaetzold.util.LinkedStateDecider
first, second
 
Constructor Summary
StateDeciderLinkedStateDecider()
           
StateDeciderLinkedStateDecider(StateDecider first, StateDecider second, StateDecider linker)
           
 
Method Summary
 StateDecider getLinkDecider()
           
 boolean isCacheable()
          Tells whether this instance will in the future produce the same state for the same value argument, independent of the actualState.
 double nextStateValue(double actualState, double value)
          Return the next state.
 void setLinkDecider(StateDecider linker)
           
 
Methods inherited from class de.jaetzold.util.LinkedStateDecider
getFirstDecider, getSecondDecider, setFirstDecider, setSecondDecider
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

linker

protected StateDecider linker
Constructor Detail

StateDeciderLinkedStateDecider

public StateDeciderLinkedStateDecider()

StateDeciderLinkedStateDecider

public StateDeciderLinkedStateDecider(StateDecider first,
                                      StateDecider second,
                                      StateDecider linker)
Method Detail

nextStateValue

public double nextStateValue(double actualState,
                             double value)
Description copied from interface: StateDecider
Return the next state. The result may depend on the given actualState and the current value but is allowed to depend on anything else. Be sure to have isCacheable() return a correct result then.
Following copied from interface: de.jaetzold.util.StateDecider
See Also:
StateDecider.isCacheable()

isCacheable

public boolean isCacheable()
Description copied from interface: StateDecider
Tells whether this instance will in the future produce the same state for the same value argument, independent of the actualState. This can be false first and then true at a later time, but it is not legal to return false here after a return of true in the past, because the true answer before was wrong then.
Overrides:
isCacheable in class LinkedStateDecider
Following copied from interface: de.jaetzold.util.StateDecider
Returns:
true if this instance guarantees, that any further call to nextStateValue() with the same value-argument returns the same state

getLinkDecider

public StateDecider getLinkDecider()

setLinkDecider

public void setLinkDecider(StateDecider linker)
                    throws PropertyVetoException