public interface SparseList<E> extends List<E>
List
for efficient implementations if lists containing mostly
null
elements.Modifier and Type | Interface and Description |
---|---|
static class |
SparseList.Span
A Span describes an inclusive, consecutive range of list indices.
|
Modifier and Type | Method and Description |
---|---|
void |
addNulls(int index,
int length)
Add/insert a sequence of
null at the given index (in)to the list. |
E |
clear(int index)
Clear the element at the given index.
|
Iterator<SparseList.Span> |
spanIterator()
Return an iterator over the populated
SparseList.Span s of this sparse list. |
Iterator<SparseList.Span> |
spanIterator(int min,
int max)
Return an iterator over the populated
SparseList.Span s of this sparse 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
parallelStream, removeIf, stream
Iterator<SparseList.Span> spanIterator()
SparseList.Span
s of this sparse list. A span is a
consecutive range of non-null
entries in the list.Iterator<SparseList.Span> spanIterator(int min, int max)
SparseList.Span
s of this sparse list. A span is a
consecutive range of non-null
entries in the list. Only entries within the range
[min..max]
are considered.min
- the minimum index to considermax
- the maximum index to considervoid addNulls(int index, int length)
null
at the given index (in)to the list.E clear(int index)
List.remove(int)
, the indices of all
other elements are unaffected by this operation.Copyright © 2024 levigo holding gmbh. All rights reserved.