public class GuardedAction extends MetaInfo implements UseDef
Event
events, a guard
Guard
predicate,
and an associated action Action
.
When clock event happens, if guard becomes true
then an action proceeds.Constructor and Description |
---|
GuardedAction(Guard guard,
Action action)
Constructs guarded action object from the specified guard and action.
|
Modifier and Type | Method and Description |
---|---|
Action |
getAction()
Returns action.
|
java.util.Collection<Event> |
getClocks()
Returns guarded action clocks.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines()
Returns a set of defined variables.
|
EventList |
getEventList()
Returns list of object's clock events.
|
Guard |
getGuard()
Returns guard.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses()
Returns a set of used variables.
|
java.lang.Iterable<ru.ispras.fortress.expression.NodeVariable> |
getUsesByAction()
Returns variables that are used by action.
|
java.lang.Iterable<ru.ispras.fortress.expression.NodeVariable> |
getUsesByGuard()
Returns variables that are used by guard.
|
boolean |
isSensible(Event event)
Checks if the specified event is in a sensitivity list of this guarded action.
|
boolean |
isSensible(EventList eventList)
Checks if this guarded action is sensible to the specified events.
|
void |
setClock(Event clock)
Associates this guarded action with the specified
Event as a clock. |
void |
setClocks(java.util.Collection<Event> clocks)
Sets guarded action clocks.
|
java.lang.String |
toString() |
addMetaInfo, addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo, removeMetaInfo, removeMetaInfo
public Action getAction()
public Guard getGuard()
public EventList getEventList()
public java.util.Collection<Event> getClocks()
public void setClock(Event clock)
Event
as a clock.clock
- clock eventjava.lang.NullPointerException
- when argument is null
.public void setClocks(java.util.Collection<Event> clocks)
clocks
- clocks collectionjava.lang.NullPointerException
- when argument is null
.public java.lang.Iterable<ru.ispras.fortress.expression.NodeVariable> getUsesByGuard()
public java.lang.Iterable<ru.ispras.fortress.expression.NodeVariable> getUsesByAction()
public boolean isSensible(Event event)
event
- the event to be testedtrue
if the specified event is in the sensitivity list of this guarded action
or the list is empty. Otherwise returns false
public boolean isSensible(EventList eventList)
eventList
- an event list to be testedtrue
if at least one of the specified events is in the sensitivity list of
this guarded action or the sensitivity list is empty. Otherwise returns false
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getUses()
UseDef
public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getDefines()
UseDef
getDefines
in interface UseDef
public java.lang.String toString()
toString
in class java.lang.Object