gestIT
Class SimpleTmpExp

java.lang.Object
  extended by gestIT.TmpExp
      extended by gestIT.SimpleTmpExp

public class SimpleTmpExp
extends TmpExp

Subclass of TmpExp that represent a simple building block. A simple building block can check a constraint, if it is constructed with an ExpContent

Author:
nicola

Field Summary
 ExpContent Content
          The Content that will check the constraint
 Token token
          The token of the execution
 
Fields inherited from class gestIT.TmpExp
Completed, Error, Iterative, Optional, Parent, Performing, state, type
 
Constructor Summary
SimpleTmpExp()
          Constructor that return a new SimpleTmpExp without ExpContent connected
SimpleTmpExp(ExpContent cnt)
          Constructor that return a new SimpleTmpExp with an ExpContent connected
 
Method Summary
 boolean Accepts(ExpEventArgs arg)
          Method that check if event parameters will satisfy the current simple building block
 boolean Consume(ExpEventArgs arg)
          Method that consume an event
 void Invalidate(ExpEventArgs arg)
          Invalidate the following simple building block and set the state to error If the current building block is flagged as iterative, it will be setted back to enable state
 void SetExecState(ExecState state, Token token)
          Method for changing the execution state of a building block
 
Methods inherited from class gestIT.TmpExp
addCompletedListener, addErrorListener, addOnStateChangedListener, addPerformingListener, getState, removeCompletedListener, removeErrorListener, removeOnStateChangedListener, removePerformingListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Content

public ExpContent Content
The Content that will check the constraint


token

public Token token
The token of the execution

Constructor Detail

SimpleTmpExp

public SimpleTmpExp()
Constructor that return a new SimpleTmpExp without ExpContent connected


SimpleTmpExp

public SimpleTmpExp(ExpContent cnt)
Constructor that return a new SimpleTmpExp with an ExpContent connected

Parameters:
cnt - The ExpContent that will check the constraint
Method Detail

Accepts

public boolean Accepts(ExpEventArgs arg)
Method that check if event parameters will satisfy the current simple building block

Parameters:
arg - The event parameter to be checked
Returns:
True if the event meet the constraint, else otherwise

Consume

public boolean Consume(ExpEventArgs arg)
Method that consume an event

Parameters:
arg - The event parameter to be consumed
Returns:
True if the event meet has been consumed, else otherwise

Invalidate

public void Invalidate(ExpEventArgs arg)
Invalidate the following simple building block and set the state to error If the current building block is flagged as iterative, it will be setted back to enable state

Parameters:
arg -

SetExecState

public void SetExecState(ExecState state,
                         Token token)
Description copied from class: TmpExp
Method for changing the execution state of a building block

Overrides:
SetExecState in class TmpExp
Parameters:
state - The new state for the building block
token - The token that must be passed