Package org.apache.calcite.util
Class ChunkList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
org.apache.calcite.util.ChunkList<E>
- Type Parameters:
E
- element type
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,List<E>
Implementation of list similar to
LinkedList
, but stores elements
in chunks of 32 elements.
ArrayList has O(n) insertion and deletion into the middle of the list. ChunkList insertion and deletion are O(1).
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionCreates an empty ChunkList.ChunkList
(Collection<E> collection) Creates a ChunkList whose contents are a given Collection. -
Method Summary
Methods inherited from class java.util.AbstractList
equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Constructor Details
-
ChunkList
public ChunkList()Creates an empty ChunkList. -
ChunkList
Creates a ChunkList whose contents are a given Collection.
-
-
Method Details
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
- Specified by:
listIterator
in classAbstractSequentialList<E>
-
size
public int size()- Specified by:
size
in interfaceCollection<E>
- Specified by:
size
in interfaceList<E>
- Specified by:
size
in classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<E>
- Specified by:
clear
in interfaceList<E>
- Overrides:
clear
in classAbstractList<E>
-
add
- Specified by:
add
in interfaceCollection<E>
- Specified by:
add
in interfaceList<E>
- Overrides:
add
in classAbstractList<E>
-
add
-