ch.tatool.core.element.handler.score
Class BoundaryPointsAndLevelHandler

java.lang.Object
  extended by ch.tatool.core.element.AbstractPropertyHolder
      extended by ch.tatool.core.element.NodeImpl
          extended by ch.tatool.core.element.handler.score.AbstractPointsAndLevelHandler
              extended by ch.tatool.core.element.handler.score.BoundaryPointsAndLevelHandler
All Implemented Interfaces:
PointsAndLevelHandler, PropertyHolder, Node, ExecutionPhaseListener

public class BoundaryPointsAndLevelHandler
extends AbstractPointsAndLevelHandler

PointsAndLevelHandler that performs a level change once the number of points pass a boundry value.

Author:
Michael Ruflin

Nested Class Summary
 
Nested classes/interfaces inherited from interface ch.tatool.core.element.handler.score.PointsAndLevelHandler
PointsAndLevelHandler.LevelListener, PointsAndLevelHandler.PointAdaptor
 
Field Summary
static String PROPERTY_BOUNDARY_VALUE
           
static String PROPERTY_CURRENT_LEVEL_TOTAL_POINTS
           
 
Fields inherited from class ch.tatool.core.element.handler.score.AbstractPointsAndLevelHandler
startLevel, startMaxPoints, startMinPoints, startPoints, ZERO_POINTS
 
Constructor Summary
BoundaryPointsAndLevelHandler()
           
 
Method Summary
protected  int checkLevelChange(ExecutionContext context, int currentLevel)
          Compares the current level total value to the boundary value, and adapts the level accordingly.
protected  void initializeHandler(ExecutionContext context)
           
 void setBoundaryValue(int value)
           
protected  void updateTotals(ExecutionContext context)
          Overridden to also adapt the current level total
 
Methods inherited from class ch.tatool.core.element.handler.score.AbstractPointsAndLevelHandler
getDescription, informLevelChangeListeners, processExecutionPhase, processLevel, processPoints, setDescription, updateStatusRegion
 
Methods inherited from class ch.tatool.core.element.NodeImpl
assignParent, assignParent, assignParents, getId, getLocalId, getParent, setId, setLocalId, setParent
 
Methods inherited from class ch.tatool.core.element.AbstractPropertyHolder
clearProperties, getKeys, getProperty, removeProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.tatool.element.Node
getParent, setParent
 
Methods inherited from interface ch.tatool.data.PropertyHolder
clearProperties, getId, getKeys, getProperty, removeProperty, setProperty
 

Field Detail

PROPERTY_CURRENT_LEVEL_TOTAL_POINTS

public static final String PROPERTY_CURRENT_LEVEL_TOTAL_POINTS
See Also:
Constant Field Values

PROPERTY_BOUNDARY_VALUE

public static final String PROPERTY_BOUNDARY_VALUE
See Also:
Constant Field Values
Constructor Detail

BoundaryPointsAndLevelHandler

public BoundaryPointsAndLevelHandler()
Method Detail

setBoundaryValue

public void setBoundaryValue(int value)

updateTotals

protected void updateTotals(ExecutionContext context)
Overridden to also adapt the current level total

Overrides:
updateTotals in class AbstractPointsAndLevelHandler

checkLevelChange

protected int checkLevelChange(ExecutionContext context,
                               int currentLevel)
Compares the current level total value to the boundary value, and adapts the level accordingly.

Specified by:
checkLevelChange in class AbstractPointsAndLevelHandler
Returns:
the new level. This can be the old level value

initializeHandler

protected void initializeHandler(ExecutionContext context)
Specified by:
initializeHandler in class AbstractPointsAndLevelHandler


Copyright © 2012. All Rights Reserved.