E - type of elements stored in the listpublic abstract class KeyListImpl<E> extends IList<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.
|
boolean |
addIf(E elem)
Adds element if allowed and returns true.
|
java.util.Set<E> |
asSet()
Returns a Set view of the element set.
|
<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 list.
|
void |
clear() |
java.lang.Object |
clone()
Returns a shallow copy of this list instance.
|
boolean |
contains(java.lang.Object elem) |
boolean |
containsKey(int keyIndex,
java.lang.Object key)
Checks whether the specified key exists in this list.
|
KeyListImpl<E> |
copy()
Returns a shallow copy of this list instance.
|
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) |
IList<E> |
getAll(E elem)
Returns all elements in the list equal to the specified element.
|
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 |
getCount(E elem)
Counts how many times the specified element is contained in the list.
|
int |
getCountByKey(int keyIndex,
java.lang.Object key)
Returns number of elements with specified key.
|
java.util.Set<E> |
getDistinct()
Returns distinct elements in the list.
|
java.util.Set<?> |
getDistinctKeys(int keyIndex)
Returns set containing all distinct keys.
|
IFunction<E,java.lang.Object> |
getKeyMapper(int keyIndex)
Returns mapper for specified key map.
|
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.
|
boolean |
isSorted()
Determines whether this list is sorted or not.
|
IList<E> |
removeAll(E elem)
Removes all equal elements.
|
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.
|
void |
trimToSize()
An application can use this operation to minimize the storage of an instance.
|
addAll, addAll, addAll, addAll, addArray, addArray, addFirst, addIfAbsent, addLast, addMult, addMult, binarySearch, containsAll, containsAny, copy, descendingIterator, drag, element, equals, extract, extractWhere, fill, filter, getAll, getArray, getFirst, getLast, getWhere, hashCode, 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, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, removeWhere, replaceAll, replaceAll, replaceArray, replaceMult, resize, retainAll, retainAll, retainWhere, reverse, reverse, rotate, rotate, setAll, setAll, setArray, setMult, sort, swap, toArray, toArray, toArray, toString, transferCopy, transferMove, transferRemove, transferSwap, unmodifiableListpublic java.lang.Object clone()
IListpublic KeyListImpl<E> copy()
IListcopy in class IList<E>IList.clone()public KeyListImpl<E> crop()
public java.util.Set<E> asSet()
java.lang.IllegalArgumentException - if the element set cannot be viewed as Setpublic boolean isSorted()
public int capacity()
IListpublic int size()
public E get(int index)
public boolean contains(java.lang.Object elem)
public boolean add(E elem)
Note that the behavior of the operation depends on the defined constraints.
public boolean addIf(E elem)
elem - element to addpublic 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 void ensureCapacity(int minCapacity)
IListensureCapacity in class IList<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 IFunction<E,java.lang.Object> getKeyMapper(int keyIndex)
keyIndex - key indexpublic 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)
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)public void sort(int index,
int len,
java.util.Comparator<? super E> comparator)
IListpublic IList<E> getAll(E elem)
IListpublic int getCount(E elem)
IListpublic IList<E> removeAll(E elem)
IListpublic java.util.Set<E> getDistinct()
IListgetDistinct in class IList<E>public void trimToSize()
IListtrimToSize in class IList<E>