org.eclipse.incquery.runtime.evm.api

## Class ActivationLifeCycle

- java.lang.Object
- - org.eclipse.incquery.runtime.evm.api.ActivationLifeCycle

- Direct Known Subclasses:
    UnmodifiableActivationLifeCycle

      public class ActivationLifeCycle
      extends java.lang.Object

  A life cycle describes how the state of an activation changes in response to an event. The internal representation is a state machine with each transition labeled with an activation life-cycle event.
  Author:
    Abel Hegedus

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addStateTransition(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.
    `boolean` | `containsFrom(ActivationState state)` Check that the life-cycle contains a transition from the given state.
    `boolean` | `containsTo(ActivationState state)` Check that the life-cycle contains a transition to the given state.
    `static ActivationLifeCycle` | `copyOf(ActivationLifeCycle lifeCycle)` Creates a complete copy of the life-cycle
    `static ActivationLifeCycle` | `create(ActivationState inactiveState)`
    `ActivationState` | `getInactiveState()`
    `com.google.common.collect.Table<ActivationState,EventType,ActivationState>` | `getStateTransitionTable()` Returns a copy of the transition table.
    `ActivationState` | `nextActivationState(ActivationState currentState, EventType event)` Returns the state in the life cycle that is defined as the next state from the given current state in response to the given event.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### nextActivationState

          public ActivationState nextActivationState(ActivationState currentState,
                                                     EventType event)

      Returns the state in the life cycle that is defined as the next state from the given current state in response to the given event. If there is no transition for the given event, the method returns null.
      Parameters:
        `currentState` - the current state of the activation
        `event` - the event that causes the state transition
      Returns:
        the next state if defined, null otherwise

    - #### addStateTransition

          public boolean addStateTransition(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. If the (from,event) transition already exists in the life-cycle, it is overwritten with the given to state.
      Parameters:
        `from` - the source state of the transition
        `event` - the event causing the transition
        `to` - the target state of the transition
      Returns:
        true, if the life-cycle changed

    - #### containsFrom

          public boolean containsFrom(ActivationState state)

      Check that the life-cycle contains a transition from the given state.
      Parameters:
        `state` -
      Returns:
        true, if there is a transition from the given state, false otherwise

    - #### containsTo

          public boolean containsTo(ActivationState state)

      Check that the life-cycle contains a transition to the given state.
      Parameters:
        `state` -
      Returns:
        true, if there is a transition to the given state, false otherwise

    - #### copyOf

          public static ActivationLifeCycle copyOf(ActivationLifeCycle lifeCycle)

      Creates a complete copy of the life-cycle
      Parameters:
        `lifeCycle` - the life-cycée to be copied
      Returns:
        the copy of the life-cycle

    - #### create

          public static ActivationLifeCycle create(ActivationState inactiveState)

    - #### getStateTransitionTable

          public com.google.common.collect.Table<ActivationState,EventType,ActivationState> getStateTransitionTable()

      Returns a copy of the transition table.
      Returns:
        the copy of the stateTransitionTable

    - #### getInactiveState

          public ActivationState getInactiveState()

      Returns:
        the inactiveState

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`