Interface State.Group

Enclosing interface:
State

public static interface State.Group
A State.Group deactivates all other states when a state in the group is activated. By default, all states may be inactive. Use fallback(State) to specify a state that is activated when the last active state is deactivated.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(State state)
    Adds a state to this State.Group.
    void
    add(Collection<State> states)
    Adds the given states to this State.Group.
    void
    fallback(State state)
    Sets a fallback state to activate when the last active state in the group is deactivated.
  • Method Details

    • add

      void add(State state)

      Adds a state to this State.Group. If the given state is already in the group, this method has no effect.

      Adding an active state deactivates all other states in the group.

      Parameters:
      state - the State instance to add
    • add

      void add(Collection<State> states)
      Adds the given states to this State.Group.
      Parameters:
      states - the State instances to add
    • fallback

      void fallback(State state)
      Sets a fallback state to activate when the last active state in the group is deactivated. The fallback state must be a member of this group.
      Parameters:
      state - the fallback State
      Throws:
      IllegalArgumentException - in case the given state is not a member of the group