E - type of elements stored in the listpublic class KeyList<E> extends KeyListImpl<E>
| Modifier and Type | Class and Description |
|---|---|
static class |
KeyList.Builder<E>
Builder to construct KeyList instances.
|
| Modifier and Type | Method and Description |
|---|---|
KeyList<E> |
copy()
Returns a shallow copy of this list instance.
|
KeyList<E> |
crop()
Returns a copy this list but without elements.
|
IList<E> |
getAll(E elem)
Returns all elements in the list equal to the specified element.
|
int |
getCount(E elem)
Counts how many times the specified element is contained in the list.
|
java.util.Set<E> |
getDistinct()
Returns distinct elements in the list.
|
E |
put(E elem)
Adds or replaces element.
|
IList<E> |
removeAll(E elem)
Removes all equal elements.
|
KeyList<E> |
unmodifiableList()
Returns an unmodifiable view of this list.
|
add, add, addIf, asSet, binarySearch, capacity, clear, clone, contains, containsKey, ensureCapacity, get, getAllByKey, getByKey, getCountByKey, getDistinctKeys, getKeyMapper, indexOf, indexOfKey, indexOfKey, isSorted, set, size, sort, trimToSizeaddAll, 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, transferSwappublic KeyList<E> copy()
IListcopy in class KeyListImpl<E>IList.clone()public KeyList<E> crop()
KeyListImplcrop in class KeyListImpl<E>public IList<E> getAll(E elem)
IListgetAll in class KeyListImpl<E>elem - element to look forpublic int getCount(E elem)
IListgetCount in class KeyListImpl<E>elem - element to countpublic IList<E> removeAll(E elem)
IListremoveAll in class KeyListImpl<E>elem - elementpublic java.util.Set<E> getDistinct()
IListgetDistinct in class KeyListImpl<E>public E put(E elem)
KeyListImpl
if (contains(elem)) {
remove(elem);
}
add(elem);
However the method is atomic in the sense that all or none operations are executed.
So if there is already such an element, but adding the new one fails due to a constraint violation,
the old element remains in the list.elem - elementpublic KeyList<E> unmodifiableList()
IListunmodifiableList in class IList<E>