E
- type of elements stored in the collectionpublic class KeyCollection<E> extends KeyCollectionImpl<E>
Key1List
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
KeyCollection.Builder<E>
Builder to construct KeyCollection instances.
|
KeyCollectionImpl.BuilderImpl<E>
Modifier | Constructor and Description |
---|---|
protected |
KeyCollection()
Protected constructor used by builder or derived collections.
|
Modifier and Type | Method and Description |
---|---|
KeyCollection<E> |
copy()
Returns a copy of this collection with all its elements.
|
KeyCollection<E> |
crop()
Returns a copy of this collection but without elements.
|
KeyCollection<E> |
filter(java.util.function.Predicate<? super E> filter)
Create a new collection by applying the specified filter to all elements.
|
KeyCollection<E> |
getAll(E elem)
Returns all equal elements.
|
protected KeyCollection.Builder<E> |
getBuilder() |
void |
invalidate(E elem)
Invalidate element, i.e. all keys of the element are extracted
again and stored in the key maps.
|
E |
put(E elem)
Adds or replaces element.
|
KeyCollection<E> |
removeAll(E elem)
Removes all equal elements.
|
add, addAll, asSet, clear, clone, contains, containsAll, containsKey, doAdd, doRemoveByKey, equals, filterMap, flatMap, getAllByKey, getAllByKey, getAllKeys, getByKey, getCount, getCountByKey, getDistinct, getDistinctKeys, getKeyMapper, hashCode, initClone, invalidateKey, isEmpty, isSorted, iterator, map, mapFilter, putByKey, remove, removeAll, removeAllByKey, removeAllByKey, removeByKey, retainAll, size, toArray, toArray, toList, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsIf, countIf, getFirst, getFirstOrNull, getIf, getSingle, getSingleOrNull
protected KeyCollection()
protected KeyCollection.Builder<E> getBuilder()
public KeyCollection<E> copy()
KeyCollectionImpl
copy
in interface ICollection<E>
copy
in class KeyCollectionImpl<E>
public KeyCollection<E> crop()
KeyCollectionImpl
crop
in interface ICollection<E>
crop
in class KeyCollectionImpl<E>
public KeyCollection<E> getAll(E elem)
KeyCollectionImpl
getAll
in class KeyCollectionImpl<E>
elem
- elementpublic KeyCollection<E> removeAll(E elem)
KeyCollectionImpl
removeAll
in class KeyCollectionImpl<E>
elem
- elementpublic E put(E elem)
KeyCollectionImpl
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 KeyCollectionImpl<E>
elem
- elementpublic void invalidate(E elem)
KeyCollectionImpl
invalidate
in class KeyCollectionImpl<E>
elem
- element to invalidatepublic KeyCollection<E> filter(java.util.function.Predicate<? super E> filter)
ICollection
filter
in interface ICollection<E>
filter
in class KeyCollectionImpl<E>
filter
- filter predicate