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.
|
protected static class |
KeyList.ImmutableKeyList<E>
A read-only version of
KeyList . |
IList.IListableFromArray<E>, IList.IListableFromCollection<E>, IList.IListableFromList<E>, IList.IListableFromMult<E>
Modifier | Constructor and Description |
---|---|
protected |
KeyList()
Protected constructor used by builder or derived collections.
|
protected |
KeyList(boolean copy,
KeyList<E> that) |
Modifier and Type | Method and Description |
---|---|
KeyList<E> |
clone()
Returns a shallow copy of this list.
|
KeyList<E> |
copy()
Returns a shallow copy of this list.
|
int |
count(E elem)
Counts how many times the specified element is contained in the list.
|
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.
|
protected KeyList.Builder<E> |
getBuilder() |
java.util.Set<E> |
getDistinct()
Returns distinct elements in the list.
|
KeyList<E> |
immutableList()
Returns an immutable copy of this list.
|
boolean |
isReadOnly()
Returns true if this list is either unmodifiable or immutable, false otherwise.
|
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, asSet, binarySearch, capacity, clear, contains, containsKey, doAdd, doAssign, doClone, doCreate, doEnsureCapacity, doGet, doGetAll, doRemove, doRemoveAll, doReSet, doSet, ensureCapacity, get, getAllByKey, getAllKeys, getByKey, getCountByKey, getDefaultElem, getDistinctKeys, getKeyMapper, indexOf, indexOfKey, indexOfKey, invalidate, invalidateKey, isSorted, putByKey, remove, removeAllByKey, removeByKey, set, size, sort, trimToSize, unwrap
addAll, addAll, addAll, addAll, addArray, addArray, addArray, addArray, addFirst, addIfAbsent, addLast, addMult, addMult, asDeque, asIListable, binarySearch, checkIndex, checkIndexAdd, checkLength, checkLengths, checkNonNull, checkRange, containsAll, containsAny, containsIf, copy, countIf, descendingIterator, doAddAll, doClear, doCreateArray, doIndexOf, doIndexOfIf, doInitAll, doLastIndexOf, doLastIndexOfIf, doModify, doPutAll, doReplace, doRotate, drag, element, equals, extract, extractIf, fill, filter, filterMap, flatMap, getAll, getFirst, getFirstOrNull, getIf, getLast, getLastOrNull, getSingle, getSingleOrNull, hashCode, indexOf, indexOfIf, indexOfIf, initAll, initAll, initArray, initMult, isEmpty, iterator, lastIndexOf, lastIndexOf, lastIndexOfIf, lastIndexOfIf, listIterator, listIterator, map, mapFilter, move, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, put, putAll, putAll, putArray, putMult, remove, remove, remove, removeAll, removeAll, removeFirst, removeFirstOccurrence, removeIf, removeLast, removeLastOccurrence, replace, replaceAll, replaceAll, replaceArray, replaceMult, resize, retain, retainAll, retainAll, retainIf, reverse, reverse, rotate, rotate, setAll, setAll, setArray, setArray, setMult, sort, swap, toArray, toArray, toArray, toArray, toArray, toArray, toString, transferCopy, transferMove, transferRemove, transferSwap, transform, transformedList
protected KeyList()
protected KeyList.Builder<E> getBuilder()
public KeyList<E> copy()
IList
public KeyList<E> clone()
IList
IList.copy()
to .clone
in class KeyListImpl<E>
public KeyList<E> crop()
KeyListImpl
crop
in interface ICollection<E>
crop
in class KeyListImpl<E>
public IList<E> getAll(E elem)
IList
getAll
in class KeyListImpl<E>
elem
- element to look forpublic int count(E elem)
IList
count
in class KeyListImpl<E>
elem
- element to countpublic IList<E> removeAll(E elem)
IList
removeAll
in class KeyListImpl<E>
elem
- elementpublic java.util.Set<E> getDistinct()
IList
getDistinct
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.
put
in class KeyListImpl<E>
elem
- elementpublic boolean isReadOnly()
IList
isReadOnly
in class IList<E>
public KeyList<E> unmodifiableList()
IList
IList.immutableList()
to get an immutable copy of a list.unmodifiableList
in class IList<E>
public KeyList<E> immutableList()
IList
IList.unmodifiableList()
to get unmodifiable view of a list.immutableList
in class IList<E>