Class LongBigList.ReadOnlyLongBigList
java.lang.Object
org.magicwerk.brownies.collections.primitive.ILongList
org.magicwerk.brownies.collections.primitive.LongBigList
org.magicwerk.brownies.collections.primitive.LongBigList.ReadOnlyLongBigList
- All Implemented Interfaces:
Serializable, Cloneable
- Enclosing class:
LongBigList
A read-only version of
.
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.
invalid reference
Key1List
- Author:
- Thomas Mauch
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class LongBigList
LongBigList.ReadOnlyLongBigListNested classes/interfaces inherited from class ILongList
ILongList.ILongListableFromArray, ILongList.ILongListableFromCollection, ILongList.ILongListableFromList, ILongList.ILongListableFromMult -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrivate constructor used internally. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoAdd(int index, long elem) Helper method for adding an element to the list.protected voiddoClear()protected voiddoModify()This method is called internally before elements are allocated or freed.protected longdoRemove(int index) Helper method to remove an element.protected voiddoRemoveAll(int index, int len) Remove specified range of elements from list.protected longdoReSet(int index, long elem) Sets an element at specified position.protected longdoSet(int index, long elem) Helper method for setting an element in the list.Methods inherited from class LongBigList
binarySearch, blockSize, capacity, clone, copy, create, create, create, crop, doAddAll, doAssign, doClone, doCreate, doEnsureCapacity, doGet, EMPTY, finalize, getDefaultElem, immutableList, isReadOnly, size, sort, trimToSize, unmodifiableListMethods inherited from class ILongList
add, add, addAll, addAll, addAll, addAll, addArray, addArray, addArray, addArray, addFirst, addIfAbsent, addLast, addMult, addMult, asILongListable, binarySearch, checkIndex, checkIndexAdd, checkLength, checkLengths, checkNonNull, checkRange, clear, contains, containsAll, containsAny, containsIf, copy, count, countIf, doCreateArray, doGetAll, doIndexOf, doIndexOfIf, doInitAll, doLastIndexOf, doLastIndexOfIf, doPutAll, doReplace, doRotate, drag, element, ensureCapacity, equals, extract, extractIf, fill, filter, filterMap, flatMap, get, getAll, getAll, getDistinct, getFirst, getFirstOrNull, getIf, getLast, getLastOrNull, getSingle, getSingleOrNull, hashCode, indexOf, indexOf, indexOfIf, indexOfIf, initAll, initAll, initArray, initMult, isEmpty, lastIndexOf, lastIndexOf, lastIndexOfIf, lastIndexOfIf, map, mapFilter, move, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, put, putAll, putAll, putArray, putMult, remove, remove, remove, removeAll, removeAll, removeAll, removeElem, removeFirst, removeFirstOccurrence, removeIf, removeLast, removeLastOccurrence, replace, replaceAll, replaceAll, replaceArray, replaceMult, resize, retain, retainAll, retainAll, retainIf, reverse, reverse, rotate, rotate, set, setAll, setAll, setArray, setArray, setMult, sort, swap, toArray, toArray, toArray, toArray, toArray, toArray, toString, transferCopy, transferMove, transferRemove, transferSwap, transform, transformedList
-
Constructor Details
-
ReadOnlyLongBigList
Private constructor used internally.- Parameters:
that- list to create an immutable view of
-
-
Method Details
-
doAdd
protected boolean doAdd(int index, long elem) Description copied from class:ILongListHelper method for adding an element to the list. This is the only method which really adds an element. Override if you need to validity checks before adding.- Overrides:
doAddin classLongBigList- Parameters:
index- index where element should be added (-1 means it is up to the implementation to choose the index)elem- element to add- Returns:
- true if element has been added, false otherwise
-
doSet
protected long doSet(int index, long elem) Description copied from class:ILongListHelper method for setting an element in the list. This is the only method which really sets an element. Override if you need to validity checks before setting.- Overrides:
doSetin classLongBigList- Parameters:
index- index where element will be placedelem- element to set- Returns:
- old element which was at the position
-
doReSet
protected long doReSet(int index, long elem) Description copied from class:ILongListSets an element at specified position. This method is used internally if existing elements will be moved etc. Override if you need to validity checks.- Overrides:
doReSetin classLongBigList- Parameters:
index- index where element will be placedelem- element to set- Returns:
- old element which was at the position
-
doRemove
protected long doRemove(int index) Description copied from class:ILongListHelper method to remove an element. This is the only method which really removes an element. Override if you need to validity checks before removing.- Overrides:
doRemovein classLongBigList- Parameters:
index- index of element to remove- Returns:
- removed element
-
doRemoveAll
protected void doRemoveAll(int index, int len) Description copied from class:ILongListRemove specified range of elements from list.- Overrides:
doRemoveAllin classLongBigList- Parameters:
index- index of first element to removelen- number of elements to remove
-
doClear
protected void doClear()- Overrides:
doClearin classLongBigList
-
doModify
-