E - type of elements stored in the listpublic class KeyListImpl<E> extends GapList<E>
GapList,
Serialized Form| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E elem)
Note that the behavior of the operation depends on the defined constraints.
|
void |
add(int index,
E elem)
Note that the behavior of the operation depends on the defined constraints.
|
java.util.Set<E> |
asSet()
Returns a set view of the collection.
|
<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 |
capacity()
Returns capacity of this GapList.
|
void |
clear() |
boolean |
containsKey(int keyIndex,
java.lang.Object key)
Checks whether the specified key exists in this list.
|
static <E> GapList<E> |
create()
Do not use.
|
static <E> GapList<E> |
create(java.util.Collection<? extends E> coll)
Do not use.
|
static <E> GapList<E> |
create(E... elems)
Do not use.
|
static <E> GapList<E> |
create(int capacity)
Do not use.
|
KeyListImpl<E> |
crop()
Returns a copy this list but without elements.
|
void |
ensureCapacity(int minCapacity)
Increases the capacity of this GapList instance, if
necessary, to ensure that it can hold at least the number of elements
specified by the minimum capacity argument.
|
E |
get(int index) |
GapList<E> |
getAllByKey(int keyIndex,
java.lang.Object key)
Returns a list with all elements with the specified key.
|
E |
getByKey(int keyIndex,
java.lang.Object key)
Returns value for given key.
|
int |
getCountByKey(int keyIndex,
java.lang.Object key)
Returns number of elements with specified key.
|
java.util.Set<?> |
getDistinctKeys(int keyIndex)
Returns list containing all distinct keys.
|
int |
indexOf(java.lang.Object elem) |
int |
indexOfKey(int keyIndex,
java.lang.Object key)
Find given key and return its index.
|
int |
indexOfKey(int keyIndex,
java.lang.Object key,
int start)
Find given key and return its index.
|
E |
set(int index,
E elem)
Note that the behavior of the operation depends on the defined constraints.
|
int |
size() |
void |
sort(int index,
int len,
java.util.Comparator<? super E> comparator)
Sort specified elements in the list using the specified comparator.
|
addAll, addAll, addAll, addAll, addAll, addAll, addFirst, addLast, binarySearch, clone, contains, containsAll, containsAny, copy, copy, copy, descendingIterator, element, EMPTY, equals, fill, fill, getAll, getArray, getFirst, getLast, hashCode, init, init, init, init, init, isEmpty, iterator, lastIndexOf, listIterator, listIterator, move, move, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, remove, removeAll, removeAll, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, resize, retainAll, retainAll, reverse, reverse, rotate, rotate, setAll, setAll, setAll, sort, swap, swap, toArray, toArray, toArray, toString, trimToSize, unmodifiableListpublic static <E> GapList<E> create()
public static <E> GapList<E> create(int capacity)
public static <E> GapList<E> create(java.util.Collection<? extends E> coll)
public static <E> GapList<E> create(E... elems)
public java.util.Set<E> asSet()
public int capacity()
GapListpublic int size()
public E get(int index)
public boolean add(E elem)
Note that the behavior of the operation depends on the defined constraints.
public void add(int index,
E elem)
Note that the behavior of the operation depends on the defined constraints.
public E set(int index, E elem)
Note that the behavior of the operation depends on the defined constraints.
public void clear()
public KeyListImpl<E> crop()
public void ensureCapacity(int minCapacity)
GapListensureCapacity in class GapList<E>minCapacity - the desired minimum capacitypublic int indexOf(java.lang.Object elem)
public int indexOfKey(int keyIndex,
java.lang.Object key)
keyIndex - key indexkey - key to findpublic int indexOfKey(int keyIndex,
java.lang.Object key,
int start)
keyIndex - key indexkey - key to findstart - start index for searchpublic boolean containsKey(int keyIndex,
java.lang.Object key)
keyIndex - key indexkey - key to look forpublic E getByKey(int keyIndex, java.lang.Object key)
keyIndex - key indexkey - key to findpublic GapList<E> getAllByKey(int keyIndex, java.lang.Object key)
keyIndex - key indexkey - key which elements must havepublic int getCountByKey(int keyIndex,
java.lang.Object key)
keyIndex - key indexkey - key which elements must havepublic java.util.Set<?> getDistinctKeys(int keyIndex)
keyIndex - key indexpublic <K> int binarySearch(int index,
int len,
K key,
java.util.Comparator<? super K> comparator)
GapListbinarySearch in class GapList<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)