public class GuardedAction extends MetaInfo implements UseDef
Constructor and Description |
---|
GuardedAction(java.util.Collection<ru.ispras.fortress.expression.Node> predicates,
Action action)
Constructs object from the specified guard predicates and the specified action.
|
GuardedAction(Guard guard,
Action action)
Constructs object with the specified guard condition and action.
|
GuardedAction(GuardedAction guardedAction)
Creates a copy of the specified object.
|
GuardedAction(ru.ispras.fortress.expression.Node guardNode,
Action action)
Constructs object with the specified guard expression node and action.
|
GuardedAction(ru.ispras.fortress.expression.Node guard,
Action action,
EventList clocks)
Constructs object with the specified node guard, action and clock events.
|
Modifier and Type | Method and Description |
---|---|
void |
addClock(Event clock)
Adds the specified clock event to this object's collection.
|
void |
addClocks(EventList clocks)
Adds the specified clock events collection to the object's collection.
|
boolean |
clockFree()
Checks whether this object does not contain clocks.
|
GuardedAction |
deepCopy()
Returns a deep copy of the object.
|
boolean |
equals(java.lang.Object object) |
Action |
getAction()
Returns action.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getActionUses()
Returns variables that are used in
Action action. |
ru.ispras.fortress.expression.Node |
getClockGuardNode()
Returns a conjunction of guard's node and a node formed by clock events.
|
ru.ispras.fortress.expression.Node |
getClockNode()
Returns a node that is formed by clock events.
|
EventList |
getClocks()
Returns clock events.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getDefines()
Returns a set of defined variables.
|
ru.ispras.fortress.expression.Node |
getGuardNode()
Returns guard's node.
|
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getGuardUses()
Returns variables that are used in
Guard condition. |
java.util.Set<ru.ispras.fortress.expression.NodeVariable> |
getUses()
Returns a set of used variables.
|
int |
hashCode() |
boolean |
isSensible(EventList eventList)
Checks if this guarded action is sensible to the specified events.
|
java.lang.String |
toString() |
addMetaInfo, addMetaInfo, addMetaInfo, getMetaInfo, getMetaInfo, hasMetaInfo, hasMetaInfo
public GuardedAction(ru.ispras.fortress.expression.Node guard, Action action, EventList clocks)
guard
- Guard predicate.action
- Action block.clocks
- Clock events.public GuardedAction(Guard guard, Action action)
guard
- guardaction
- actionjava.lang.IllegalArgumentException
- when any of arguments is null
.public GuardedAction(ru.ispras.fortress.expression.Node guardNode, Action action)
guardNode
- Guard expression.action
- Action.public GuardedAction(java.util.Collection<ru.ispras.fortress.expression.Node> predicates, Action action)
predicates
- Guard predicates.action
- Action.public GuardedAction(GuardedAction guardedAction)
guardedAction
- The object this is created from.public GuardedAction deepCopy()
public Action getAction()
public ru.ispras.fortress.expression.Node getGuardNode()
public ru.ispras.fortress.expression.Node getClockGuardNode()
public ru.ispras.fortress.expression.Node getClockNode()
null
if there is no such.public EventList getClocks()
public boolean clockFree()
true
if this object does not contain clocks, false
otherwise.public void addClock(Event clock)
clock
- clock eventjava.lang.IllegalArgumentException
- when argument is null
.public void addClocks(EventList clocks)
clocks
- clocks collectionjava.lang.IllegalArgumentException
- when argument is null
.public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getGuardUses()
Guard
condition.public java.util.Set<ru.ispras.fortress.expression.NodeVariable> getActionUses()
Action
action.public boolean isSensible(EventList eventList)
eventList
- an event list to be testedtrue
if at least one of the specified events
is in the object's clock collection or it is empty, false
otherwise.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
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object