Package org.skriptlang.skript.lang.util
Class SkriptQueue
java.lang.Object
- All Implemented Interfaces:
AnyAmount
,AnyProvider
,YggdrasilSerializable
,Serializable
,Cloneable
,Iterable<Object>
,Collection<Object>
,Deque<Object>
,List<Object>
,Queue<Object>
,SequencedCollection<Object>
public class SkriptQueue
extends LinkedList<@NotNull Object>
implements Deque<Object>, Queue<Object>, YggdrasilSerializable, AnyAmount
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.yggdrasil.YggdrasilSerializable
YggdrasilSerializable.YggdrasilExtendedSerializable, YggdrasilSerializable.YggdrasilRobustEnum, YggdrasilSerializable.YggdrasilRobustSerializable
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection<?> list) void
void
@NotNull Number
amount()
boolean
Object[]
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, 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 ch.njol.skript.lang.util.common.AnyAmount
isEmpty, setAmount, supportsAmountChange
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods 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, size
Methods 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:
toArray
in interfaceCollection<Object>
- Specified by:
toArray
in interfaceList<Object>
- Overrides:
toArray
in 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
-