E - type of elements stored in the listpublic class KeyCollection<E> extends KeyCollectionImpl<E>
Key1List,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
KeyCollection.Builder<E>
Builder to construct TableCollection instances.
|
KeyCollectionImpl.BuilderImpl<E>| 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.
|
GapList<E> |
getAll(E elem)
Returns all equal elements.
|
int |
getCount(E elem)
Returns the number of equal elements.
|
java.util.Set<E> |
getDistinct()
Returns all distinct elements in the same order as in the collection.
|
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.
|
GapList<E> |
removeAll(E elem)
Removes all equal elements.
|
public KeyCollection<E> copy()
KeyCollectionImplcopy in class KeyCollectionImpl<E>public KeyCollection<E> crop()
KeyCollectionImplcrop in class KeyCollectionImpl<E>public GapList<E> getAll(E elem)
KeyCollectionImplelem - elementpublic int getCount(E elem)
KeyCollectionImplelem - elementpublic GapList<E> removeAll(E elem)
KeyCollectionImplelem - elementpublic java.util.Set<E> getDistinct()
KeyCollectionImplpublic E put(E elem)
KeyCollectionImpl
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 void invalidate(E elem)
KeyCollectionImplelem - element to invalidate