Class LinkedArgumentStack

All Implemented Interfaces:
Serializable, Cloneable, Iterable<String>, Collection<String>, Deque<String>, List<String>, Queue<String>, ArgumentStack

public final class LinkedArgumentStack extends LinkedList<String> implements ArgumentStack
See Also:
  • Constructor Details

    • LinkedArgumentStack

      public LinkedArgumentStack(@NotNull @NotNull Collection<? extends String> c)
    • LinkedArgumentStack

      public LinkedArgumentStack(@NotNull @NotNull String... c)
  • Method Details

    • join

      @NotNull public @NotNull String join(String delimiter)
      Description copied from interface: ArgumentStack
      Joins all present arguments in this stack
      Specified by:
      join in interface ArgumentStack
      Parameters:
      delimiter - Delimiter between these arguments.
      Returns:
      The combined string
    • join

      @NotNull public @NotNull String join(@NotNull @NotNull String delimiter, int startIndex)
      Description copied from interface: ArgumentStack
      Joins all present arguments in this stack, starting from the specified index
      Specified by:
      join in interface ArgumentStack
      Parameters:
      delimiter - Delimiter between these arguments
      startIndex - The start index to combine from
      Returns:
      The combined string
    • popForParameter

      @NotNull public @NotNull String popForParameter(@NotNull @NotNull CommandParameter parameter)
      Description copied from interface: ArgumentStack
      Returns (and removes) the string in which might get concatenated with the rest of the arguments if the parameter consumes all strings that follow it.
      Specified by:
      popForParameter in interface ArgumentStack
      Parameters:
      parameter - The parameter to get for
      Returns:
      The string for this parameter. Will return the first argument if the parameter cannot consume all strings.
      See Also:
    • asImmutableView

      @NotNull public @NotNull @UnmodifiableView List<String> asImmutableView()
      Description copied from interface: ArgumentStack
      Returns this argument stack as an immutable view. This can be therefore passed to any conditions or resolvers without having to worry about being unintentionally modified.

      Note that this does not create an independent copy, and instead returns a view which does not allow modifications. If this argument stack gets modified from somewhere else, the immutable view will also be modified.

      Specified by:
      asImmutableView in interface ArgumentStack
      Returns:
      The argument stack as an immutable view
    • asImmutableCopy

      @NotNull public @NotNull @Unmodifiable List<String> asImmutableCopy()
      Description copied from interface: ArgumentStack
      Returns an immutable copy of this stack. This copy will behave independently of the original ArgumentStack.
      Specified by:
      asImmutableCopy in interface ArgumentStack
      Returns:
      An immutable copy of this ArgumentStack.