Package revxrsal.commands.core
Class LinkedArgumentStack
java.lang.Object
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<String>
,Collection<String>
,Deque<String>
,List<String>
,Queue<String>
,ArgumentStack
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionLinkedArgumentStack
(@NotNull String... c) LinkedArgumentStack
(@NotNull Collection<? extends String> c) -
Method Summary
Modifier and TypeMethodDescriptionReturns an immutable copy of this stack.Returns this argument stack as an immutable view.@NotNull String
Joins all present arguments in this stack, starting from the specified index@NotNull String
Joins all present arguments in this stack@NotNull String
popForParameter
(@NotNull CommandParameter parameter) Returns (and removes) the string in which might get concatenated with the rest of the arguments if the parameterconsumes all strings
that follow it.Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArray
Methods inherited from class java.util.AbstractSequentialList
iterator
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Deque
add, addAll, addFirst, addLast, contains, descendingIterator, element, getFirst, getLast, iterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, size
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Constructor Details
-
LinkedArgumentStack
-
LinkedArgumentStack
-
-
Method Details
-
join
Description copied from interface:ArgumentStack
Joins all present arguments in this stack- Specified by:
join
in interfaceArgumentStack
- Parameters:
delimiter
- Delimiter between these arguments.- Returns:
- The combined string
-
join
Description copied from interface:ArgumentStack
Joins all present arguments in this stack, starting from the specified index- Specified by:
join
in interfaceArgumentStack
- Parameters:
delimiter
- Delimiter between these argumentsstartIndex
- The start index to combine from- Returns:
- The combined string
-
popForParameter
Description copied from interface:ArgumentStack
Returns (and removes) the string in which might get concatenated with the rest of the arguments if the parameterconsumes all strings
that follow it.- Specified by:
popForParameter
in interfaceArgumentStack
- 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
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 interfaceArgumentStack
- Returns:
- The argument stack as an immutable view
-
asImmutableCopy
Description copied from interface:ArgumentStack
Returns an immutable copy of this stack. This copy will behave independently of the originalArgumentStack
.- Specified by:
asImmutableCopy
in interfaceArgumentStack
- Returns:
- An immutable copy of this
ArgumentStack
.
-