E
- type of elements stored in the listK
- type of keypublic class Key1List<E,K> extends KeyListImpl<E>
Modifier and Type | Class and Description |
---|---|
static class |
Key1List.Builder<E,K>
Builder to construct Key1List instances.
|
protected static class |
Key1List.ReadOnlyKey1List<E,K>
A read-only version of
Key1List . |
IList.IListableFromArray<E>, IList.IListableFromCollection<E>, IList.IListableFromList<E>, IList.IListableFromMult<E>
Modifier | Constructor and Description |
---|---|
protected |
Key1List()
Protected constructor used by builder or derived collections.
|
protected |
Key1List(boolean copy,
Key1List<E,K> that) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<K,E> |
asMap1()
Returns a map view to the key map.
|
Key1List<E,K> |
clone()
Returns a shallow copy of this list.
|
boolean |
containsKey1(K key)
Checks whether an element with specified key exists.
|
Key1List<E,K> |
copy()
Returns a shallow copy of this list.
|
int |
count(E elem)
Counts how many times the specified element is contained in the list.
|
Key1List<E,K> |
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.
|
IList<E> |
getAllByKey1(K key)
Returns all elements with specified key.
|
IList<K> |
getAllKeys1()
Returns list containing all keys in element order.
|
protected Key1List.Builder<E,K> |
getBuilder() |
E |
getByKey1(K key)
Returns element with specified key.
|
int |
getCountByKey1(K key)
Returns the number of elements with specified key.
|
java.util.Set<E> |
getDistinct()
Returns distinct elements in the list.
|
java.util.Set<K> |
getDistinctKeys1()
Returns all distinct keys in the same order as in the key map.
|
java.util.function.Function<E,K> |
getKey1Mapper()
Returns mapper for key map.
|
Key1List<E,K> |
immutableList()
Returns an immutable copy of this list.
|
int |
indexOfKey1(K key)
Returns index of first element in list with specified key.
|
void |
invalidateKey1(K oldKey,
K newKey,
E elem)
Invalidate key value of element.
|
boolean |
isReadOnly()
Returns true if this list is either unmodifiable or immutable, false otherwise.
|
E |
put(E elem)
Adds or replaces element.
|
E |
putByKey1(E elem)
Adds element by key.
|
E |
putIfAbsentByKey1(E elem)
Adds or replaces element by key.
|
IList<E> |
removeAll(E elem)
Removes all equal elements.
|
IList<E> |
removeAllByKey1(K key)
Removes all elements with specified key.
|
E |
removeByKey1(K key)
Removes element with specified key.
|
Key1List<E,K> |
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 Key1List()
protected Key1List.Builder<E,K> getBuilder()
public Key1List<E,K> copy()
IList
public Key1List<E,K> clone()
IList
IList.copy()
to .clone
in class KeyListImpl<E>
public Key1List<E,K> 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 java.util.function.Function<E,K> getKey1Mapper()
public java.util.Map<K,E> asMap1()
java.lang.IllegalArgumentException
- if the key map cannot be viewed as Mappublic int indexOfKey1(K key)
key
- keypublic boolean containsKey1(K key)
key
- keypublic E getByKey1(K key)
key
- keypublic IList<E> getAllByKey1(K key)
key
- keypublic int getCountByKey1(K key)
key
- keypublic E removeByKey1(K key)
key
- keypublic IList<E> removeAllByKey1(K key)
key
- keypublic IList<K> getAllKeys1()
public java.util.Set<K> getDistinctKeys1()
public E putByKey1(E elem)
removeByKey1(elem.getKey1()); 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 E putIfAbsentByKey1(E elem)
if (!containsKey1(elem.getKey1())) { 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 void invalidateKey1(K oldKey, K newKey, E elem)
oldKey
- old key valuenewKey
- new key valueelem
- element to invalidate (can be null if there are no duplicates with this key)public boolean isReadOnly()
IList
isReadOnly
in class IList<E>
public Key1List<E,K> unmodifiableList()
IList
IList.immutableList()
to get an immutable copy of a list.unmodifiableList
in class IList<E>
public Key1List<E,K> immutableList()
IList
IList.unmodifiableList()
to get unmodifiable view of a list.immutableList
in class IList<E>