public class CharGapList extends ICharList
Note that this implementation is not synchronized.
Note that the iterators provided are not fail-fast.
List,
ArrayList,
LinkedList,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CAPACITY
Default capacity for list
|
| Constructor and Description |
|---|
CharGapList()
Construct a list with the default initial capacity.
|
CharGapList(java.util.Collection<java.lang.Character> coll)
Construct a list to contain the specified elements.
|
CharGapList(int capacity)
Construct a list with specified initial capacity.
|
CharGapList(java.lang.String str) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(char elem) |
void |
add(int index,
char elem) |
int |
binarySearch(int index,
int len,
char key)
Searches the specified range for an object using the binary
search algorithm.
|
int |
capacity()
Returns capacity of this list.
|
java.lang.Object |
clone()
Returns a shallow copy of this CharGapList instance
(The elements themselves are not copied).
|
CharGapList |
copy()
Returns a shallow copy of this CharGapList instance.
|
static CharGapList |
create()
Create new list.
|
static CharGapList |
create(char... elems)
Create new list with specified elements.
|
static CharGapList |
create(java.util.Collection<java.lang.Character> coll)
Create new list with specified elements.
|
static CharGapList |
create(java.lang.String str) |
ICharList |
doCreate(int capacity)
Create list with specified capacity.
|
static CharGapList |
EMPTY() |
void |
ensureCapacity(int minCapacity)
Increases the capacity of this CharGapList instance, if
necessary, to ensure that it can hold at least the number of elements
specified by the minimum capacity argument.
|
char |
get(int index) |
CharGapList |
getAll(char elem)
Returns all elements in the list equal to the specified element.
|
CharGapList |
getAll(int index,
int len)
Returns specified range of elements from list.
|
char |
getDefaultElem() |
void |
init()
Initialize the list to be empty.
|
void |
init(char... elems)
Initialize the list to contain the specified elements only.
|
void |
init(java.util.Collection<java.lang.Character> coll)
Initialize the list to contain the specified elements only.
|
void |
init(java.lang.String str) |
<R> GapList<R> |
mappedList(IFunction<java.lang.Character,R> mapper)
Create a new list by applying the specified mapper to all elements.
|
char |
remove(int index) |
int |
size() |
void |
sort(int index,
int len)
Sort specified elements in the list using the specified comparator.
|
void |
trimToSize()
Trims the capacity of this CharGapList instance to be the list's current size.
|
CharGapList |
unmodifiableList()
Returns an unmodifiable view of this list.
|
addAll, addAll, addAll, addAll, addArray, addArray, addFirst, addIfAbsent, addLast, addMult, addMult, binarySearch, clear, contains, containsAll, containsAny, copy, drag, element, equals, extract, extractWhere, fill, filter, getArray, getCount, getDistinct, getFirst, getLast, getWhere, hashCode, indexOf, indexOf, initAll, initAll, initArray, initMult, isEmpty, lastIndexOf, lastIndexOf, move, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, put, putAll, putAll, putArray, putMult, remove, remove, removeAll, removeAll, removeAll, removeElem, 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 static final int DEFAULT_CAPACITY
public CharGapList()
public CharGapList(int capacity)
capacity - capacitypublic CharGapList(java.util.Collection<java.lang.Character> coll)
coll - collection with elementspublic CharGapList(java.lang.String str)
public static CharGapList EMPTY()
public static CharGapList create()
type - of elements stored in the listpublic static CharGapList create(java.util.Collection<java.lang.Character> coll)
coll - collection with elementtype - of elements stored in the listpublic static CharGapList create(char... elems)
elems - array with elementstype - of elements stored in the listpublic void init()
public void init(java.util.Collection<java.lang.Character> coll)
coll - collection with elementspublic void init(char... elems)
elems - array with elementspublic char getDefaultElem()
public CharGapList copy()
copy in class ICharListICharList.clone()public void ensureCapacity(int minCapacity)
ensureCapacity in class ICharListminCapacity - the desired minimum capacitypublic java.lang.Object clone()
public CharGapList unmodifiableList()
ICharListunmodifiableList in class ICharListpublic int capacity()
ICharListpublic CharGapList getAll(int index, int len)
ICharListpublic CharGapList getAll(char elem)
ICharListpublic <R> GapList<R> mappedList(IFunction<java.lang.Character,R> mapper)
ICharListmappedList in class ICharListmapper - mapper functionpublic void trimToSize()
trimToSize in class ICharListpublic ICharList doCreate(int capacity)
ICharListcapacity - initial capacity (use -1 for default capacity)public 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 CharGapList create(java.lang.String str)
public void init(java.lang.String str)