Package org.skriptlang.skript.lang.util
Class SkriptQueue
java.lang.Object
- All Implemented Interfaces:
AnyAmount,AnyProvider,Container<Object>,Serializable,Cloneable,Iterable<Object>,Collection<Object>,Deque<Object>,List<Object>,Queue<Object>,SequencedCollection<Object>
@ContainerType(java.lang.Object.class)
public class SkriptQueue
extends LinkedList<@NotNull Object>
implements Deque<Object>, Queue<Object>, AnyAmount, Container<Object>
A queue of elements.
Elements will only be added to the queue if they are not null, with nothing happening if the elements are null.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.njol.skript.util.Container
Container.ContainerType -
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<?> list) voidvoid@NotNull Numberamount()booleanObject[]removeRangeSafely(int fromIndex, int toIndex) Removes a range of elements from the queue.removeSafely(int i) @NotNull Object @NotNull []toArray()Methods inherited from class java.util.LinkedList
addAll, clear, clone, 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, reversed, size, spliterator, toArrayMethods inherited from class java.util.AbstractSequentialList
iteratorMethods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.njol.skript.lang.util.common.AnyAmount
isEmpty, setAmount, supportsAmountChangeMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Deque
addAll, descendingIterator, element, getFirst, getLast, iterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, reversed, sizeMethods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Constructor Details
-
SkriptQueue
public SkriptQueue()
-
-
Method Details
-
add
-
add
-
addFirst
-
addLast
-
contains
-
set
-
addAll
-
toArray
- Specified by:
toArrayin interfaceCollection<Object>- Specified by:
toArrayin interfaceList<Object>- Overrides:
toArrayin classLinkedList<@NotNull Object>
-
removeSafely
-
removeRangeSafely
Removes a range of elements from the queue. This will adjust the start/end of the range to be within the bounds of the queue, to avoid throwing an error.- Parameters:
fromIndex- The starting index (inclusive)toIndex- The ending index (exclusive)- Returns:
- The removed entries
-
amount
-
containerIterator
- Specified by:
containerIteratorin interfaceContainer<Object>- Returns:
- All element within this container in no particular order
-