public class BooleanLinkedList extends AbstractBooleanList implements BooleanPriorityDequeue, BooleanStack
This implementation is optimized to improve how data is processed with interfaces like BooleanStack
and with optimized functions that use type-specific implementations for primitives and optimized logic for bulk actions.
| Constructor and Description |
|---|
BooleanLinkedList()
Creates a new LinkedList.
|
BooleanLinkedList(boolean... a)
Creates a new LinkedList with a Copy of the array
|
BooleanLinkedList(boolean[] a,
int length)
Creates a new LinkedList with a Copy of the array with a custom length
|
BooleanLinkedList(boolean[] a,
int offset,
int length)
Creates a new LinkedList with a Copy of the array with in the custom range.
|
BooleanLinkedList(BooleanCollection c)
Creates a new LinkedList a copy with the contents of the Collection.
|
BooleanLinkedList(BooleanList l)
Creates a new LinkedList a copy with the contents of the List.
|
BooleanLinkedList(java.util.Collection<? extends java.lang.Boolean> c)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(boolean e)
A Type-Specific implementation of add function that delegates to
List.add(int, Object) |
void |
add(int index,
boolean e)
A Type-Specific add Function to reduce (un)boxing
|
boolean |
addAll(boolean[] e,
int offset,
int length)
A Type-Specific Array based addAll method to reduce the amount of Wrapping
|
boolean |
addAll(int index,
BooleanCollection c)
A Type-Specific addAll Function to reduce (un)boxing
|
boolean |
addAll(int index,
BooleanList c)
A Type-Specific and optimized addAll function that allows a faster transfer of elements
|
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Boolean> c)
Deprecated.
|
void |
addElements(int from,
boolean[] a,
int offset,
int length)
A function to fast add elements to the list
|
void |
clear()
clears all elements within the PriorityQueue,
this does not resize the backing arrays
|
BooleanComparator |
comparator() |
boolean |
contains(boolean e)
A Type-Specific implementation of contains.
|
boolean |
contains(java.lang.Object e)
Deprecated.
|
BooleanLinkedList |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(Boolean2BooleanFunction filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
boolean |
dequeue()
Method to extract a element from the PriorityQueue
|
boolean |
dequeueLast()
A Method to remove a element from the last place instead of the first
|
void |
enqueue(boolean e)
Method to insert a element into the PriorityQueue
|
void |
enqueueFirst(boolean e)
Method to insert a element into the first Index instead of the last.
|
boolean[] |
extractElements(int from,
int to)
A function to fast extract elements out of the list, this removes the elements that were fetched.
|
boolean |
findFirst(Boolean2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
boolean |
first()
Shows the element that is to be returned next
|
void |
forEach(BooleanConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
<E> void |
forEach(E input,
ObjectBooleanConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
boolean |
getBoolean(int index)
A Type-Specific get function to reduce (un)boxing
|
boolean[] |
getElements(int from,
boolean[] a,
int offset,
int length)
A function to fast fetch elements from the list
|
int |
indexOf(boolean e)
The indexOf implementation iterates over all elements and compares them to the search value.
|
int |
indexOf(java.lang.Object o)
Deprecated.
|
boolean |
last()
Peeking function for the last element
|
int |
lastIndexOf(boolean e)
The lastIndexOf implementation iterates over all elements and compares them to the search value.
|
int |
lastIndexOf(java.lang.Object o)
Deprecated.
|
BooleanListIterator |
listIterator(int index)
A Type-Specific Iterator of listIterator
|
boolean |
matchesAll(Boolean2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(Boolean2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(Boolean2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
void |
onChanged()
Allows to notify the Queue to be revalidate its data
|
boolean |
peek(int index)
Peeking function to see whats inside the queue.
|
boolean |
pop()
Removes the Object on top of the stack.
|
void |
push(boolean e)
Inserts a given Object on top of the stack
|
boolean |
reduce(boolean identity,
BooleanBooleanUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
reduce(BooleanBooleanUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remBoolean(boolean e)
A Type-Specific implementation of remove.
|
boolean |
removeAll(BooleanCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(BooleanCollection c,
BooleanConsumer r)
A Type-Specific removeAll function that reduces (un)boxing.
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
removeBoolean(int index)
A Type-Specific remove function to reduce (un)boxing
|
void |
removeElements(int from,
int to)
a function to fast remove elements from the list.
|
boolean |
removeFirst(boolean e)
Removes the first found element in the queue
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Boolean> filter)
Deprecated.
|
boolean |
removeLast(boolean e)
Removes the last found element in the queue
|
void |
replaceAll(java.util.function.UnaryOperator<java.lang.Boolean> o)
Deprecated.
|
boolean |
retainAll(BooleanCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(BooleanCollection c,
BooleanConsumer r)
A Type-Specific retainAll function that reduces (un)boxing.
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
set(int index,
boolean e)
A Type-Specific set function to reduce (un)boxing
|
int |
size()
Provides the amount of elements currently in the stack
|
BooleanSplititerator |
spliterator()
A Type Specific Type Splititerator to reduce boxing/unboxing
|
boolean |
swapRemove(int index)
A Highly Optimized remove function that removes the desired element.
|
boolean |
swapRemoveBoolean(boolean e)
A Highly Optimized remove function that removes the desired element.
|
java.lang.Object[] |
toArray() |
<E> E[] |
toArray(E[] a) |
boolean[] |
toBooleanArray(boolean[] a)
A Type-Specific implementation of toArray.
|
add, addAll, addAll, addAll, equals, hashCode, iterator, listIterator, size, subListadd, containsAll, containsAll, containsAny, containsAny, remove, toBooleanArrayenqueueAllFirst, enqueueAllFirst, enqueueAllFirst, enqueueAllFirst, synchronizeQueue, synchronizeQueueenqueueAll, enqueueAll, enqueueAll, enqueueAll, isEmpty, toBooleanArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, iterator, limit, map, peek, pour, pourAsList, sortedisEmpty, topadd, addElements, addElements, addIfAbsent, addIfPresent, get, getElements, remove, remove, set, sort, sort, synchronize, synchronize, unmodifiable, unstableSort, unstableSortaddAll, addAll, containsAll, containsAny, containsAny, pour, toBooleanArraypublic BooleanLinkedList()
@Deprecated public BooleanLinkedList(java.util.Collection<? extends java.lang.Boolean> c)
c - the elements that should be added into the listpublic BooleanLinkedList(BooleanCollection c)
c - the elements that should be added into the listpublic BooleanLinkedList(BooleanList l)
l - the elements that should be added into the listpublic BooleanLinkedList(boolean... a)
a - the array that should be copiedpublic BooleanLinkedList(boolean[] a,
int length)
a - the array that should be copiedlength - the desired length that should be copiedpublic BooleanLinkedList(boolean[] a,
int offset,
int length)
a - the array that should be copiedoffset - the starting offset of where the array should be copied fromlength - the desired length that should be copiedjava.lang.IllegalStateException - if offset is smaller then 0java.lang.IllegalStateException - if the offset + length exceeds the array lengthpublic boolean add(boolean e)
AbstractBooleanListList.add(int, Object)add in interface BooleanCollectionadd in interface BooleanListadd in class AbstractBooleanListe - the element to addList.add(Object)public void add(int index,
boolean e)
BooleanListadd in interface BooleanListindex - index at which the specified element is to be insertede - the element to addList.add(int, Object)public boolean addAll(int index,
BooleanCollection c)
BooleanListaddAll in interface BooleanListindex - index at which the specified elements is to be insertedc - the elements that need to be addedList.addAll(int, java.util.Collection)public boolean addAll(int index,
BooleanList c)
BooleanListaddAll in interface BooleanListindex - index at which the specified elements is to be insertedc - the elements that need to be added@Deprecated
public boolean addAll(int index,
java.util.Collection<? extends java.lang.Boolean> c)
addAll in interface java.util.List<java.lang.Boolean>public void enqueue(boolean e)
BooleanPriorityQueueenqueue in interface BooleanPriorityQueuee - the element that should be insertedpublic void enqueueFirst(boolean e)
BooleanPriorityDequeueenqueueFirst in interface BooleanPriorityDequeuee - the element that should be inserted into the first placepublic void push(boolean e)
BooleanStackpush in interface BooleanStacke - the Object to insertStack.push(Object)public boolean addAll(boolean[] e,
int offset,
int length)
BooleanCollectionaddAll in interface BooleanCollectione - the elements that should be addedoffset - where to start within the arraylength - how many elements of the array should be addedpublic void addElements(int from,
boolean[] a,
int offset,
int length)
BooleanListaddElements in interface BooleanListfrom - the index where the elements should be added into the lista - the elements that should be addedoffset - the start index of the array should be read fromlength - how many elements should be read frompublic boolean[] getElements(int from,
boolean[] a,
int offset,
int length)
BooleanListgetElements in interface BooleanListfrom - index where the list should be fetching elements froma - the array where the values should be inserted tooffset - the startIndex of where the array should be written tolength - the number of elements the values should be fetched frompublic boolean first()
BooleanPriorityQueuefirst in interface BooleanPriorityQueuepublic boolean last()
BooleanPriorityDequeuelast in interface BooleanPriorityDequeuepublic boolean peek(int index)
BooleanPriorityQueuepeek in interface BooleanStackpeek in interface BooleanPriorityQueueindex - of the element that is requested to be viewed.Stack.peek(int)public boolean getBoolean(int index)
BooleanListgetBoolean in interface BooleanListindex - the index of the value that is requestedList.get(int)@Deprecated public boolean contains(java.lang.Object e)
AbstractBooleanCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
contains in interface java.util.Collection<java.lang.Boolean>contains in interface java.util.List<java.lang.Boolean>contains in interface BooleanCollectioncontains in interface BooleanListcontains in class AbstractBooleanCollection@Deprecated public int indexOf(java.lang.Object o)
AbstractBooleanListindexOf in interface java.util.List<java.lang.Boolean>indexOf in interface BooleanListindexOf in class AbstractBooleanListo - the value that the index is searched for.@Deprecated public int lastIndexOf(java.lang.Object o)
AbstractBooleanListlastIndexOf in interface java.util.List<java.lang.Boolean>lastIndexOf in interface BooleanListlastIndexOf in class AbstractBooleanListo - the value that the index is searched for.public boolean contains(boolean e)
AbstractBooleanCollectioncontains in interface BooleanCollectioncontains in class AbstractBooleanCollectione - the element that should be searched for.public int indexOf(boolean e)
AbstractBooleanListindexOf in interface BooleanListindexOf in class AbstractBooleanListe - the value that the index is searched for.public int lastIndexOf(boolean e)
AbstractBooleanListlastIndexOf in interface BooleanListlastIndexOf in class AbstractBooleanListe - the value that the index is searched for.public BooleanListIterator listIterator(int index)
BooleanListlistIterator in interface java.util.List<java.lang.Boolean>listIterator in interface BooleanListlistIterator in class AbstractBooleanListList.listIterator(int)public BooleanSplititerator spliterator()
spliterator in interface java.lang.Iterable<java.lang.Boolean>spliterator in interface java.util.Collection<java.lang.Boolean>spliterator in interface java.util.List<java.lang.Boolean>spliterator in interface BooleanCollectionspliterator in interface BooleanIterablespliterator in interface BooleanListpublic void forEach(BooleanConsumer action)
BooleanIterableforEach in interface BooleanIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public <E> void forEach(E input,
ObjectBooleanConsumer<E> action)
BooleanIterableforEach in interface BooleanIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(Boolean2BooleanFunction filter)
BooleanIterablematchesAny in interface BooleanIterablefilter - that should be appliedpublic boolean matchesNone(Boolean2BooleanFunction filter)
BooleanIterablematchesNone in interface BooleanIterablefilter - that should be appliedpublic boolean matchesAll(Boolean2BooleanFunction filter)
BooleanIterablematchesAll in interface BooleanIterablefilter - that should be appliedpublic boolean findFirst(Boolean2BooleanFunction filter)
BooleanIterablefindFirst in interface BooleanIterablefilter - that should be appliedpublic boolean reduce(boolean identity,
BooleanBooleanUnaryOperator operator)
BooleanIterablereduce in interface BooleanIterableidentity - the start valueoperator - the operation that should be appliedpublic boolean reduce(BooleanBooleanUnaryOperator operator)
BooleanIterablereduce in interface BooleanIterableoperator - the operation that should be appliedpublic int count(Boolean2BooleanFunction filter)
BooleanIterablecount in interface BooleanIterablefilter - that should be appliedpublic boolean set(int index,
boolean e)
BooleanListset in interface BooleanListindex - index of the element to replacee - element to be stored at the specified positionList.set(int, Object)@Deprecated public void replaceAll(java.util.function.UnaryOperator<java.lang.Boolean> o)
replaceAll in interface java.util.List<java.lang.Boolean>public void onChanged()
BooleanPriorityQueueonChanged in interface BooleanPriorityQueuepublic BooleanComparator comparator()
comparator in interface BooleanPriorityQueuepublic boolean dequeue()
BooleanPriorityQueuedequeue in interface BooleanPriorityQueuepublic boolean dequeueLast()
BooleanPriorityDequeuedequeueLast in interface BooleanPriorityDequeuepublic boolean pop()
BooleanStackpop in interface BooleanStackStack.pop()public boolean removeFirst(boolean e)
BooleanPriorityQueueremoveFirst in interface BooleanPriorityQueuee - the element that should be removedpublic boolean removeLast(boolean e)
BooleanPriorityQueueremoveLast in interface BooleanPriorityQueuee - the element that should be removedpublic boolean swapRemove(int index)
BooleanListswapRemove in interface BooleanListindex - the index of the element to be removedpublic boolean swapRemoveBoolean(boolean e)
BooleanListswapRemoveBoolean in interface BooleanListswapRemoveBoolean in class AbstractBooleanListe - the element that should be removedpublic boolean remBoolean(boolean e)
AbstractBooleanCollectionremBoolean in interface BooleanCollectionremBoolean in class AbstractBooleanCollectione - the element that is searched forCollection.remove(Object)public boolean removeBoolean(int index)
BooleanListremoveBoolean in interface BooleanListindex - the index of the element to be removedList.remove(int)public void removeElements(int from,
int to)
BooleanListremoveElements in interface BooleanListfrom - the start index of where the elements should be removed from (inclusive)to - the end index of where the elements should be removed to (exclusive)public boolean[] extractElements(int from,
int to)
BooleanListextractElements in interface BooleanListfrom - the start index of where the elements should be fetched from (inclusive)to - the end index of where the elements should be fetched to (exclusive)@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Boolean>removeAll in interface java.util.List<java.lang.Boolean>removeAll in class java.util.AbstractCollection<java.lang.Boolean>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Boolean>retainAll in interface java.util.List<java.lang.Boolean>retainAll in class java.util.AbstractCollection<java.lang.Boolean>public boolean removeAll(BooleanCollection c)
AbstractBooleanCollectionremoveAll in interface BooleanCollectionremoveAll in class AbstractBooleanCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean removeAll(BooleanCollection c, BooleanConsumer r)
BooleanCollectionremoveAll in interface BooleanCollectionremoveAll in class AbstractBooleanCollectionc - the collection of elements that should be removedr - elements that got removedCollection.removeAll(Collection)public boolean retainAll(BooleanCollection c)
AbstractBooleanCollectionretainAll in interface BooleanCollectionretainAll in class AbstractBooleanCollectionc - the elements that should be keptCollection.retainAll(Collection)public boolean retainAll(BooleanCollection c, BooleanConsumer r)
BooleanCollectionretainAll in interface BooleanCollectionretainAll in class AbstractBooleanCollectionc - the collection of elements that should be keptr - elements that got removedCollection.retainAll(Collection)@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Boolean> filter)
removeIf in interface java.util.Collection<java.lang.Boolean>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Boolean>toArray in interface java.util.List<java.lang.Boolean>toArray in class java.util.AbstractCollection<java.lang.Boolean>public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Boolean>toArray in interface java.util.List<java.lang.Boolean>toArray in class java.util.AbstractCollection<java.lang.Boolean>public boolean[] toBooleanArray(boolean[] a)
AbstractBooleanCollectiontoBooleanArray in interface BooleanCollectiontoBooleanArray in interface BooleanPriorityQueuetoBooleanArray in class AbstractBooleanCollectiona - array that the elements should be injected to. If null or to small a new array with the right size is createdCollection.toArray(Object[])public int size()
BooleanStacksize in interface java.util.Collection<java.lang.Boolean>size in interface java.util.List<java.lang.Boolean>size in interface BooleanStacksize in interface BooleanPriorityQueuesize in class java.util.AbstractCollection<java.lang.Boolean>public void clear()
BooleanPriorityQueueclear in interface java.util.Collection<java.lang.Boolean>clear in interface java.util.List<java.lang.Boolean>clear in interface BooleanStackclear in interface BooleanPriorityQueueclear in class java.util.AbstractCollection<java.lang.Boolean>public BooleanLinkedList copy()
BooleanCollectioncopy in interface BooleanCollectioncopy in interface BooleanListcopy in interface BooleanPriorityDequeuecopy in interface BooleanPriorityQueuecopy in class AbstractBooleanList