public class CharBigList extends ICharList
Note that this implementation is not synchronized. Due to data caching used for exploiting locality of reference, performance can decrease if CharBigList is accessed by several threads at different positions.
Note that the iterators provided are not fail-fast.
| Modifier and Type | Class and Description |
|---|---|
static class |
CharBigList.CharBlock
A block stores in maximum blockSize number of elements.
|
| Constructor and Description |
|---|
CharBigList()
Default constructor.
|
CharBigList(java.util.Collection<java.lang.Character> coll)
Create new list with specified elements.
|
CharBigList(int blockSize)
Constructor.
|
CharBigList(java.lang.String str) |
| Modifier and Type | Method and Description |
|---|---|
int |
binarySearch(int index,
int len,
char key)
Searches the specified range for an object using the binary
search algorithm.
|
int |
blockSize()
Returns block size used for this CharBigList.
|
int |
capacity()
Returns capacity of this list.
|
java.lang.Object |
clone()
Returns a shallow copy of this CharBigList instance
The copy is realized by a copy-on-write approach so also really large lists can efficiently be copied.
|
CharBigList |
copy()
Returns a copy of this CharBigList instance.
|
static CharBigList |
create()
Create new list.
|
static CharBigList |
create(char... elems)
Create new list with specified elements.
|
static CharBigList |
create(java.util.Collection<java.lang.Character> coll)
Create new list with specified elements.
|
static CharBigList |
create(java.lang.String str) |
static CharBigList |
EMPTY() |
char |
getDefaultElem() |
void |
init()
Initialize the list to be empty.
|
void |
init(char... elems)
Initialize the list to have the specified elements.
|
void |
init(java.util.Collection<java.lang.Character> that)
Initialize the list to have all elements in the specified collection.
|
void |
init(java.lang.String str) |
static ICharList |
of(char[] values) |
static ICharList |
of(java.lang.Character[] values) |
static ICharList |
of(java.util.List<java.lang.Character> values) |
int |
size() |
void |
sort(int index,
int len)
Sort specified elements in the list using the specified comparator.
|
void |
trimToSize()
Pack as many elements in the blocks as allowed.
|
CharBigList |
unmodifiableList()
Returns an unmodifiable view of this list.
|
add, add, addAll, addAll, addAll, addAll, addAll, addAll, addFirst, addIfAbsent, addLast, binarySearch, clear, contains, containsAll, containsAny, copy, copy, drag, element, ensureCapacity, equals, extract, fill, fill, filter, get, getAll, getAll, getArray, getCount, getDistinct, getFirst, getLast, hashCode, indexOf, init, isEmpty, lastIndexOf, mappedList, merge, move, move, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeAll, removeAll, removeAll, removeElem, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, resize, retainAll, retainAll, reverse, reverse, rotate, rotate, set, setAll, setAll, setAll, sort, swap, swap, toArray, toArray, toArray, toStringpublic CharBigList()
public CharBigList(int blockSize)
blockSize - block sizepublic CharBigList(java.util.Collection<java.lang.Character> coll)
coll - collection with elementtype - of elements stored in the listpublic CharBigList(java.lang.String str)
public static ICharList of(char[] values)
public static ICharList of(java.lang.Character[] values)
public static ICharList of(java.util.List<java.lang.Character> values)
public static CharBigList EMPTY()
public static CharBigList create()
type - of elements stored in the listpublic static CharBigList create(java.util.Collection<java.lang.Character> coll)
coll - collection with elementtype - of elements stored in the listpublic static CharBigList create(char... elems)
elems - array with elementstype - of elements stored in the listpublic void init()
public void init(char... elems)
elems - elementspublic void init(java.util.Collection<java.lang.Character> that)
that - collectionpublic int blockSize()
public CharBigList copy()
copy in class ICharListICharList.clone()public java.lang.Object clone()
public char getDefaultElem()
public int capacity()
public CharBigList unmodifiableList()
ICharListunmodifiableList in class ICharListpublic void trimToSize()
trimToSize in class ICharListpublic void sort(int index,
int len)
ICharListpublic int binarySearch(int index,
int len,
char key)
ICharListbinarySearch in class ICharListindex - index of first element to searchlen - number of elements to searchkey - the value to be searched forArrays.binarySearch(long[], long)public static CharBigList create(java.lang.String str)
public void init(java.lang.String str)