it.amattioli.workstate.actions
Class AbstractGuard

Show UML class diagram
java.lang.Object
  extended by it.amattioli.workstate.actions.AbstractGuard
All Implemented Interfaces:
Guard
Direct Known Subclasses:
BeanShellGuard, NullGuard

public abstract class AbstractGuard
extends Object
implements Guard


Field Summary
static Integer USER_PRIORITY
           
 
Constructor Summary
AbstractGuard()
           
 
Method Summary
 boolean equals(Object o)
           
 Integer getPriority()
          Return the priority level for the guard evaluation.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.amattioli.workstate.actions.Guard
check
 

Field Detail

USER_PRIORITY

public static final Integer USER_PRIORITY
Constructor Detail

AbstractGuard

public AbstractGuard()
Method Detail

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getPriority

public Integer getPriority()
Description copied from interface: Guard
Return the priority level for the guard evaluation. To choose the right transition to trigger all the guards must be evaluated to know which is true. Normally all the guards should be indipendent one each other and the evaluation order should not be important. But to implement an "else" mechanism a priority has been associated to the guards. The null guard has a very low priority while all user defined guards have a high priority. In this way the null guard is always evaluated as the last guard and, as it always returns true, it works like an "else" branch. The priority should not be used for other purposes like forcing the evaluation order of user defined guards.

Specified by:
getPriority in interface Guard

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.