Class ActionsList


  • public class ActionsList
    extends Object
    Entity that stores Actions and provides basic API pertaining to the stored elements.

    Actions are stored in an internal List.

    • Constructor Detail

      • ActionsList

        ActionsList()
        Constructs an instance of an ActionsList that stores Actions and provides basic API pertaining to the stored elements.

        Actions are stored in an internal List.

    • Method Detail

      • add

        <T> void add​(Action<T> actionToAdd)
        Adds the passed Action to this actions list.

        The Action is added at the front of this actions list.

        Type Parameters:
        T - type of value returned in the result of submitted action execution
        Parameters:
        actionToAdd - Action to add to this actions list
      • getFirst

        Action<?> getFirst()
        Retrieves, but does not remove, the first Action from this actions list.
        Returns:
        the first element of this actions list
        Throws:
        NoSuchElementException - if this actions list is empty
      • isExactlyOneActionInList

        boolean isExactlyOneActionInList()
        Informs, whether this actions list stores exactly one action.
        Returns:
        true if this actions list stores exactly one action; false otherwise
      • clear

        void clear()
        Removes all Actions from this actions list.

        The list will be empty after this call returns.

      • getAll

        @Nonnull
        public List<Action<?>> getAll()
        Retrieves by reference all instances of Actions stored in this actions list.
        Returns:
        unmodifiable List of all instances of Actions stored in this actions list; the returned list isn't the same instance of List used by this actions list internally to store Actions
      • executeAll

        void executeAll()
        Executes, subsequently and starting from the first one, all Actions stored in this actions list.

        Execution is performed by calling an Action.execute() method of an executed Action.