protected static class KeyList.ImmutableKeyList<E> extends KeyList<E>
KeyList.
It is used to implement both unmodifiable and immutable lists.
Note that the client cannot change the list, but the content may change if the underlying list is changed.KeyList.Builder<E>, KeyList.ImmutableKeyList<E>IList.IListableFromArray<E>, IList.IListableFromCollection<E>, IList.IListableFromList<E>, IList.IListableFromMult<E>| Modifier | Constructor and Description |
|---|---|
protected |
ImmutableKeyList(KeyList<E> that)
Private constructor used internally.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doAdd(int index,
E elem)
Helper method for adding an element to the list.
|
protected void |
doClear() |
protected void |
doEnsureCapacity(int capacity)
Increases the capacity of this list instance, if
necessary, to ensure that it can hold at least the number of elements
specified by the minimum capacity argument.
|
protected void |
doModify()
This method is called internally before elements are allocated or freed.
|
protected E |
doRemove(int index)
Helper method to remove an element.
|
protected void |
doRemoveAll(int index,
int len)
Remove specified range of elements from list.
|
protected E |
doReSet(int index,
E elem)
Sets an element at specified position.
|
protected E |
doSet(int index,
E elem)
Helper method for setting an element in the list.
|
protected void |
invalidateKey(int keyIndex,
java.lang.Object oldKey,
java.lang.Object newKey,
E elem)
Invalidate key value of element.
|
protected E |
putByKey(int keyIndex,
E elem,
boolean replace)
Put element by key into list.
|
protected IList<E> |
removeAllByKey(int keyIndex,
java.lang.Object key)
Removes element by key.
|
protected E |
removeByKey(int keyIndex,
java.lang.Object key)
Removes element by key.
|
clone, copy, count, crop, getAll, getBuilder, getDistinct, immutableList, isReadOnly, put, removeAll, unmodifiableListadd, add, asSet, binarySearch, capacity, clear, contains, containsKey, doAssign, doClone, doCreate, doGet, doGetAll, ensureCapacity, get, getAllByKey, getAllKeys, getByKey, getCountByKey, getDefaultElem, getDistinctKeys, getKeyMapper, indexOf, indexOfKey, indexOfKey, invalidate, isSorted, remove, set, size, sort, trimToSize, unwrapaddAll, 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, doCreateArray, doIndexOf, doIndexOfIf, doInitAll, doLastIndexOf, doLastIndexOfIf, 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, transformedListprotected void doEnsureCapacity(int capacity)
IListdoEnsureCapacity in class KeyListImpl<E>capacity - the desired minimum capacityprotected boolean doAdd(int index,
E elem)
IListdoAdd in class KeyListImpl<E>index - index where element should be added
(-1 means it is up to the implementation to choose the index)elem - element to addprotected E doSet(int index, E elem)
IListdoSet in class KeyListImpl<E>index - index where element will be placedelem - element to setprotected E doReSet(int index, E elem)
IListdoReSet in class KeyListImpl<E>index - index where element will be placedelem - element to setprotected E doRemove(int index)
IListdoRemove in class KeyListImpl<E>index - index of element to removeprotected void doRemoveAll(int index,
int len)
IListdoRemoveAll in class KeyListImpl<E>index - index of first element to removelen - number of elements to removeprotected void doModify()
IListprotected E removeByKey(int keyIndex, java.lang.Object key)
KeyListImplremoveByKey in class KeyListImpl<E>keyIndex - key indexkey - key of element to removeprotected IList<E> removeAllByKey(int keyIndex, java.lang.Object key)
KeyListImplremoveAllByKey in class KeyListImpl<E>keyIndex - key indexkey - key of element to removeprotected E putByKey(int keyIndex, E elem, boolean replace)
KeyListImplputByKey in class KeyListImpl<E>keyIndex - key indexelem - element to putreplace - true to replace an existing element with the same key, false to let the element unchangedprotected void invalidateKey(int keyIndex,
java.lang.Object oldKey,
java.lang.Object newKey,
E elem)
KeyListImplinvalidateKey in class KeyListImpl<E>keyIndex - key indexoldKey - old key valuenewKey - new key valueelem - element to invalidate (can be null if there are no duplicates with this key)