de.fhg.igd.jhsm
Class HSMTransition

java.lang.Object
  extended byde.fhg.igd.jhsm.AbstractComponent
      extended byde.fhg.igd.jhsm.HSMTransition
All Implemented Interfaces:
Component, Serializable, Transition
Direct Known Subclasses:
InternalTransition, MigrationTransition

public class HSMTransition
extends AbstractComponent
implements Transition

A generic transition.

Version:
"$Id: HSMTransition.java 1913 2007-08-08 02:41:53Z jpeters $"
Author:
Jan Haevecker
See Also:
Serialized Form

Field Summary
private  Condition condition_
           
private static Logger LOG
           
private  State target_
           
private  Event trigger_
           
 
Fields inherited from class de.fhg.igd.jhsm.AbstractComponent
 
Constructor Summary
HSMTransition()
           
HSMTransition(State target)
          Creates a triggerless and guardless transition.
HSMTransition(State target, Condition guard)
          Creates a triggerless transition.
HSMTransition(State target, Condition guard, Event trigger)
          Transition with trigger event and guard condition.
HSMTransition(State target, Event trigger)
          Guardless transition with trigger event.
HSMTransition(State source, State target)
          Creates a triggerless and guardless transition.
HSMTransition(State source, State target, Condition guard)
          Creates a triggerless transition.
HSMTransition(State source, State target, Condition guard, Event trigger)
          Transition with trigger event and guard condition.
HSMTransition(State source, State target, Event trigger)
          Guardless transition with trigger event.
 
Method Summary
 void action(Context context)
          Performs the component's action in a specified context.
 Condition getGuardCondition()
          Getter for property guardCondition.
 State getTarget()
          Returns the target state of the transition.
 Event getTriggerEvent()
          Getter for property triggerEvent.
 boolean guard(Context context)
          Checks if the guard condition is met.
 boolean hasInterest(Event event)
          Checks if a given event is a trigger for the transition.
 boolean isTriggerless()
          Checks if the transition is triggerless.
 void setGuardCondition(Condition guardCondition)
          Setter for property guardCondition.
 void setParent(State parent)
           
 void setTarget(State target)
          Set's the target state of the transition.
 void setTriggerEvent(Event triggerEvent)
          Setter for property triggerEvent.
 String toString()
           
 
Methods inherited from class de.fhg.igd.jhsm.AbstractComponent
getAction, getName, getParent, setAction, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.fhg.igd.jhsm.Component
getAction, getName, getParent, setAction, setName, setParent
 

Field Detail

LOG

private static final Logger LOG

target_

private State target_

condition_

private Condition condition_

trigger_

private Event trigger_
Constructor Detail

HSMTransition

public HSMTransition()

HSMTransition

public HSMTransition(State target)
Creates a triggerless and guardless transition.


HSMTransition

public HSMTransition(State source,
                     State target)
Creates a triggerless and guardless transition.


HSMTransition

public HSMTransition(State target,
                     Condition guard)
Creates a triggerless transition.


HSMTransition

public HSMTransition(State source,
                     State target,
                     Condition guard)
Creates a triggerless transition.


HSMTransition

public HSMTransition(State target,
                     Event trigger)
Guardless transition with trigger event.


HSMTransition

public HSMTransition(State source,
                     State target,
                     Event trigger)
Guardless transition with trigger event.


HSMTransition

public HSMTransition(State target,
                     Condition guard,
                     Event trigger)
Transition with trigger event and guard condition.


HSMTransition

public HSMTransition(State source,
                     State target,
                     Condition guard,
                     Event trigger)
Transition with trigger event and guard condition.

Method Detail

action

public void action(Context context)
Description copied from interface: Component
Performs the component's action in a specified context. This is the hook for the interpreter.

Specified by:
action in interface Component
Parameters:
context - Used to publish and retrieve data for/from other actions.

guard

public boolean guard(Context context)
Description copied from interface: Transition
Checks if the guard condition is met.

Specified by:
guard in interface Transition
Parameters:
context - Used to publish and retrieve global data.

hasInterest

public boolean hasInterest(Event event)
Description copied from interface: Transition
Checks if a given event is a trigger for the transition.

Specified by:
hasInterest in interface Transition

isTriggerless

public boolean isTriggerless()
Description copied from interface: Transition
Checks if the transition is triggerless.

Specified by:
isTriggerless in interface Transition
Returns:
true if the transition has no trigger event, false if it has one.

toString

public String toString()
Overrides:
toString in class AbstractComponent

setParent

public void setParent(State parent)

setTarget

public void setTarget(State target)
Description copied from interface: Transition
Set's the target state of the transition.

Specified by:
setTarget in interface Transition

getTarget

public State getTarget()
Description copied from interface: Transition
Returns the target state of the transition.

Specified by:
getTarget in interface Transition

setGuardCondition

public void setGuardCondition(Condition guardCondition)
Description copied from interface: Transition
Setter for property guardCondition.

Specified by:
setGuardCondition in interface Transition
Parameters:
guardCondition - New value of property guardCondition.

setTriggerEvent

public void setTriggerEvent(Event triggerEvent)
Description copied from interface: Transition
Setter for property triggerEvent.

Specified by:
setTriggerEvent in interface Transition
Parameters:
triggerEvent - New value of property triggerEvent.

getGuardCondition

public Condition getGuardCondition()
Description copied from interface: Transition
Getter for property guardCondition.

Specified by:
getGuardCondition in interface Transition
Returns:
Value of property guardCondition.

getTriggerEvent

public Event getTriggerEvent()
Description copied from interface: Transition
Getter for property triggerEvent.

Specified by:
getTriggerEvent in interface Transition
Returns:
Value of property triggerEvent.


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.