public class CharGapList extends ICharList
Note that this implementation is not synchronized.
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(char... elems)
Construct a list to contain the specified elements.
|
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 GapList.
|
CharGapList |
copy()
Returns a shallow copy of this GapList instance
(the new list will contain the same elements as the source list, i.e. the elements themselves are not copied).
|
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(int capacity)
Create new list with specified capacity.
|
static CharGapList |
create(java.lang.String str) |
ICharList |
doCreate(int capacity)
Create list with specified capacity.
|
static CharGapList |
EMPTY() |
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(int capacity)
Initialize the list to be empty with specified initial capacity.
|
void |
init(java.lang.String str) |
<R> GapList<R> |
mappedList(Mapper<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 GapList instance to be the
list's current size.
|
CharGapList |
unmodifiableList()
Returns an unmodifiable view of this list.
|
addAll, addAll, addAll, addAll, addAll, addAll, addFirst, addIfAbsent, addLast, binarySearch, clear, clone, contains, containsAll, containsAny, copy, copy, drag, element, ensureCapacity, equals, fill, fill, filter, getArray, getCount, getDistinct, getFirst, getLast, hashCode, indexOf, init, isEmpty, lastIndexOf, move, move, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, 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 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(char... elems)
elems - array 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(int capacity)
capacity - capacitytype - 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(int capacity)
capacity - capacitypublic 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()
ICharListcopy in class ICharListICharList.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(Mapper<java.lang.Character,R> mapper)
ICharListmappedList in class ICharListmapper - mapper functionpublic void trimToSize()
ICharListtrimToSize 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)