Package io.github.connellite.collections
Class NullSkippingLinkedList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<E>
io.github.connellite.collections.NullSkippingLinkedList<E>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<E>,Collection<E>,Deque<E>,List<E>,Queue<E>
LinkedList that ignores null on add / offer / push / deque head-tail inserts.- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInserts a non-null element at the specified index.booleanAppends a non-null element to the tail.booleanaddAll(int index, Collection<? extends E> c) Inserts all non-null elements from the source collection starting at index.booleanaddAll(Collection<? extends E> c) Appends all non-null elements from the source collection.voidAdds a non-null element to deque head.voidAdds a non-null element to deque tail.booleanOffers a non-null element to queue tail.booleanofferFirst(E e) Offers a non-null element to deque head.booleanOffers a non-null element to deque tail.voidPushes a non-null element onto the stack view.Methods inherited from class java.util.LinkedList
clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, 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 java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subList
-
Constructor Details
-
NullSkippingLinkedList
public NullSkippingLinkedList() -
NullSkippingLinkedList
-
-
Method Details
-
add
Appends a non-null element to the tail. -
add
Inserts a non-null element at the specified index. -
addAll
Appends all non-null elements from the source collection. -
addAll
Inserts all non-null elements from the source collection starting at index. -
addFirst
Adds a non-null element to deque head. -
addLast
Adds a non-null element to deque tail. -
offer
Offers a non-null element to queue tail. -
offerFirst
Offers a non-null element to deque head.- Specified by:
offerFirstin interfaceDeque<E>- Overrides:
offerFirstin classLinkedList<E>- Parameters:
e- element to offer- Returns:
trueif accepted;falsefornull
-
offerLast
Offers a non-null element to deque tail. -
push
Pushes a non-null element onto the stack view.
-