Package jadex.bridge
Class CheckedAction
- java.lang.Object
-
- jadex.bridge.CheckedAction
-
- All Implemented Interfaces:
java.lang.Runnable
public abstract class CheckedAction extends java.lang.Object implements java.lang.RunnableCan be used as external action, which will only be executed when isValid() is true. Further, it is guaranteed that cleanup() will be executed. Contract is: if(isValid()) run(); cleanup();
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanvalidThe valid flag.
-
Constructor Summary
Constructors Constructor Description CheckedAction()Create a new action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanup()Cleanup will be executed at the end of the action.booleanisValid()Test if the timed object is valid.voidsetValid(boolean valid)Set the valid state.
-
-
-
Method Detail
-
cleanup
public void cleanup()
Cleanup will be executed at the end of the action. Override if cleanup actions are necessary.
-
isValid
public boolean isValid()
Test if the timed object is valid.- Returns:
- True, if entry is valid.
-
setValid
public void setValid(boolean valid)
Set the valid state.
-
-