Package jade.core.behaviours
Class Behaviour.RunnableChangedEvent
- java.lang.Object
-
- jade.core.behaviours.Behaviour.RunnableChangedEvent
-
- All Implemented Interfaces:
Serializable,Serializable
- Enclosing class:
- Behaviour
protected class Behaviour.RunnableChangedEvent extends Object implements Serializable
Event class for notifying blocked and restarted behaviours. This class is used to notify interested behaviours when a Behaviour changes its runnable state. It may be sent to behaviour's parent (upward notification or to behaviour's children (downward notification).- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedRunnableChangedEvent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BehaviourgetSource()Read event source.voidinit(boolean b, int d)Re-init event content.booleanisRunnable()Check whether the event is runnable.booleanisUpwards()Check which direction this event is travelling.
-
-
-
Method Detail
-
init
public void init(boolean b, int d)Re-init event content. This method can be used to rewrite an existing event with new data (much cheaper than making a new object).- Parameters:
b- Abooleanflag; whenfalseit means that a behaviour passed from Ready to Blocked state. Whentrueit means that a behaviour passed from Blocked to Ready (this flag is the truth value of the predicate 'The behaviour has now become runnable'.d- A notification direction: when direction isNOTIFY_UP, the event travels upwards the behaviour containment hierarchy; when it isNOTIFY_DOWN, the event travels downwards.
-
getSource
public Behaviour getSource()
Read event source.- Returns:
- The
Behaviourobject which generated this event.
-
isRunnable
public boolean isRunnable()
Check whether the event is runnable.- Returns:
truewhen the behaviour generating this event has become Ready,falsewhen it has become Blocked.
-
isUpwards
public boolean isUpwards()
Check which direction this event is travelling.- Returns:
truewhen the event is a notification going from a child behaviour to its parent;falseotherwise.
-
-