Class UnmodifiableActivationLifeCycle
- java.lang.Object
-
- org.eclipse.viatra.transformation.evm.api.ActivationLifeCycle
-
- org.eclipse.viatra.transformation.evm.specific.lifecycle.UnmodifiableActivationLifeCycle
-
- Direct Known Subclasses:
DefaultActivationLifeCycle
public class UnmodifiableActivationLifeCycle extends ActivationLifeCycle
This class represents life-cycles that cannot be modified. Attempts to add new transitions will result inUnsupportedOperationException.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.viatra.transformation.evm.api.ActivationLifeCycle
ActivationLifeCycle.Transition
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUnmodifiableActivationLifeCycle(ActivationState inactiveState)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddStateTransition(ActivationState from, EventType event, ActivationState to)Extends the life cycle with a new transition that is created from the given state, labeled with the given event and leading to the given state.static UnmodifiableActivationLifeCyclecopyOf(ActivationLifeCycle lifeCycle)Creates an unmodifiable copy of the given life-cycle.protected booleaninternalAddStateTransition(ActivationState activationState, EventType eventType, ActivationState activationState2)Internal method to add transitions to an unmodifiable life-cycle.-
Methods inherited from class org.eclipse.viatra.transformation.evm.api.ActivationLifeCycle
addStateTransition, containsFrom, containsTo, create, getInactiveState, getStateTransitions, nextActivationState, toString
-
-
-
-
Constructor Detail
-
UnmodifiableActivationLifeCycle
protected UnmodifiableActivationLifeCycle(ActivationState inactiveState)
- Parameters:
inactiveState-
-
-
Method Detail
-
addStateTransition
public boolean addStateTransition(ActivationState from, EventType event, ActivationState to)
Description copied from class:ActivationLifeCycleExtends the life cycle with a new transition that is created from the given state, labeled with the given event and leading to the given state. If the (from,event) transition already exists in the life-cycle, it is overwritten with the given to state.- Overrides:
addStateTransitionin classActivationLifeCycle- Parameters:
from- the source state of the transitionevent- the event causing the transitionto- the target state of the transition- Returns:
- true, if the life-cycle changed
-
internalAddStateTransition
protected boolean internalAddStateTransition(ActivationState activationState, EventType eventType, ActivationState activationState2)
Internal method to add transitions to an unmodifiable life-cycle.- Parameters:
activationState-eventType-activationState2-- Returns:
-
copyOf
public static UnmodifiableActivationLifeCycle copyOf(ActivationLifeCycle lifeCycle)
Creates an unmodifiable copy of the given life-cycle.- Parameters:
lifeCycle-
-
-