public class BigList<E> extends IList<E>
Note that this implementation is not synchronized. Due to data caching used for exploiting locality of reference, performance can decrease if BigList is accessed by several threads at different positions.
Note that the iterators provided are not fail-fast.
| Constructor and Description |
|---|
BigList()
Default constructor.
|
BigList(java.util.Collection<? extends E> coll)
Create new list with specified elements.
|
BigList(int blockSize)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<K> int |
binarySearch(int index,
int len,
K key,
java.util.Comparator<? super K> comparator)
Searches the specified range for an object using the binary
search algorithm.
|
int |
blockSize()
Returns block size used for this BigList.
|
int |
capacity()
As BigList grows and shrinks automatically, the term capacity does not really make sense.
|
java.lang.Object |
clone()
Returns a shallow copy of this BigList instance
The copy is realized by a copy-on-write approach so also really large lists can efficiently be copied.
|
BigList<E> |
copy()
Returns a copy of this BigList instance.
|
static <E> BigList<E> |
create()
Create new list.
|
static <E> BigList<E> |
create(java.util.Collection<? extends E> coll)
Create new list with specified elements.
|
static <E> BigList<E> |
create(E... elems)
Create new list with specified elements.
|
static <EE> BigList<EE> |
EMPTY() |
E |
getDefaultElem() |
int |
size() |
void |
sort(int index,
int len,
java.util.Comparator<? super E> comparator)
Sort specified elements in the list using the specified comparator.
|
void |
trimToSize()
Pack as many elements in the blocks as allowed.
|
BigList<E> |
unmodifiableList()
Returns an unmodifiable view of this list.
|
add, add, addAll, addAll, addAll, addAll, addArray, addArray, addFirst, addIfAbsent, addLast, addMult, addMult, binarySearch, clear, contains, containsAll, containsAny, copy, descendingIterator, drag, element, ensureCapacity, equals, extract, extractWhere, fill, filter, get, getAll, getAll, getArray, getCount, getDistinct, getFirst, getLast, getWhere, hashCode, indexOf, indexOf, initAll, initAll, initArray, initMult, isEmpty, iterator, lastIndexOf, lastIndexOf, listIterator, listIterator, mappedList, move, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, put, putAll, putAll, putArray, putMult, remove, remove, remove, remove, removeAll, removeAll, removeAll, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, removeWhere, replaceAll, replaceAll, replaceArray, replaceMult, resize, retainAll, retainAll, retainWhere, reverse, reverse, rotate, rotate, set, setAll, setAll, setArray, setMult, sort, swap, toArray, toArray, toArray, toString, transferCopy, transferMove, transferRemove, transferSwappublic BigList()
public BigList(int blockSize)
blockSize - block sizepublic BigList(java.util.Collection<? extends E> coll)
coll - collection with elementpublic static <EE> BigList<EE> EMPTY()
public static <E> BigList<E> create()
E - type of elements stored in the listpublic static <E> BigList<E> create(java.util.Collection<? extends E> coll)
E - type of elements stored in the listcoll - collection with elementpublic static <E> BigList<E> create(E... elems)
E - type of elements stored in the listelems - array with elementspublic int blockSize()
public BigList<E> copy()
copy in class IList<E>IList.clone()public java.lang.Object clone()
public E getDefaultElem()
public int size()
public int capacity()
public BigList<E> unmodifiableList()
IListunmodifiableList in class IList<E>public void trimToSize()
trimToSize in class IList<E>public void sort(int index,
int len,
java.util.Comparator<? super E> comparator)
IListpublic <K> int binarySearch(int index,
int len,
K key,
java.util.Comparator<? super K> comparator)
IListbinarySearch in class IList<E>index - index of first element to searchlen - number of elements to searchkey - the value to be searched forcomparator - the comparator by which the list is ordered.
A null value indicates that the elements'
natural ordering should be used.Arrays.binarySearch(long[], long)