Class CharBigList.ReadOnlyCharBigList
- java.lang.Object
-
- org.magicwerk.brownies.collections.primitive.ICharList
-
- org.magicwerk.brownies.collections.primitive.CharBigList
-
- org.magicwerk.brownies.collections.primitive.CharBigList.ReadOnlyCharBigList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.CharSequence
,java.lang.Cloneable
,ICharListable
- Enclosing class:
- CharBigList
protected static class CharBigList.ReadOnlyCharBigList extends CharBigList
A read-only version ofKey1List
. 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.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.magicwerk.brownies.collections.primitive.CharBigList
CharBigList.CharBlock, CharBigList.CharBlockNode, CharBigList.ReadOnlyCharBigList
-
Nested classes/interfaces inherited from class org.magicwerk.brownies.collections.primitive.ICharList
ICharList.ICharListableFromArray, ICharList.ICharListableFromCollection, ICharList.ICharListableFromList, ICharList.ICharListableFromMult
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
UID for serialization
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReadOnlyCharBigList(CharBigList that)
Private constructor used internally.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
doAdd(int index, char elem)
Helper method for adding an element to the list.protected void
doClear()
protected void
doModify()
This method is called internally before elements are allocated or freed.protected char
doRemove(int index)
Helper method to remove an element.protected void
doRemoveAll(int index, int len)
Remove specified range of elements from list.protected char
doReSet(int index, char elem)
Sets an element at specified position.protected char
doSet(int index, char elem)
Helper method for setting an element in the list.private void
error()
Throw exception if an attempt is made to change an immutable list.-
Methods inherited from class org.magicwerk.brownies.collections.primitive.CharBigList
binarySearch, blockSize, capacity, clone, copy, create, create, create, create, crop, doAddAll, doAssign, doClone, doCreate, doEnsureCapacity, doGet, EMPTY, finalize, getDefaultElem, immutableList, init, isReadOnly, size, sort, trimToSize, unmodifiableList
-
Methods inherited from class org.magicwerk.brownies.collections.primitive.ICharList
add, add, addAll, addAll, addAll, addAll, addArray, addArray, addArray, addArray, addFirst, addIfAbsent, addLast, addMult, addMult, asICharListable, binarySearch, charAt, checkIndex, checkIndexAdd, checkLength, checkLengths, checkNonNull, checkRange, clear, contains, containsAll, containsAny, containsIf, copy, count, countIf, doCreateArray, doGetAll, doIndexOf, doIndexOfIf, doInitAll, doLastIndexOf, doLastIndexOfIf, doPutAll, doReplace, doRotate, doTransfer, doTransferSwap, drag, element, ensureCapacity, equals, equalsElem, extract, extractIf, fill, filter, filterMap, flatMap, get, getAll, getAll, getDistinct, getFirst, getFirstOrNull, getIf, getLast, getLastOrNull, getSingle, getSingleOrNull, hashCode, hashCodeElem, indexOf, indexOf, indexOfIf, indexOfIf, initAll, initAll, initArray, initMult, isEmpty, lastIndexOf, lastIndexOf, lastIndexOfIf, lastIndexOfIf, length, 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, subSequence, swap, toArray, toArray, toArray, toArray, toArray, toArray, toArray, toString, transferCopy, transferMove, transferRemove, transferSwap, transform, transformedList
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
UID for serialization- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReadOnlyCharBigList
protected ReadOnlyCharBigList(CharBigList that)
Private constructor used internally.- Parameters:
that
- list to create an immutable view of
-
-
Method Detail
-
doAdd
protected boolean doAdd(int index, char elem)
Description copied from class:ICharList
Helper 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:
doAdd
in classCharBigList
- 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 char doSet(int index, char elem)
Description copied from class:ICharList
Helper 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:
doSet
in classCharBigList
- Parameters:
index
- index where element will be placedelem
- element to set- Returns:
- old element which was at the position
-
doReSet
protected char doReSet(int index, char elem)
Description copied from class:ICharList
Sets 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:
doReSet
in classCharBigList
- Parameters:
index
- index where element will be placedelem
- element to set- Returns:
- old element which was at the position
-
doRemove
protected char doRemove(int index)
Description copied from class:ICharList
Helper 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:
doRemove
in classCharBigList
- Parameters:
index
- index of element to remove- Returns:
- removed element
-
doRemoveAll
protected void doRemoveAll(int index, int len)
Description copied from class:ICharList
Remove specified range of elements from list.- Overrides:
doRemoveAll
in classCharBigList
- Parameters:
index
- index of first element to removelen
- number of elements to remove
-
doClear
protected void doClear()
- Overrides:
doClear
in classCharBigList
-
doModify
protected void doModify()
Description copied from class:ICharList
This method is called internally before elements are allocated or freed. Override if you need to validity checks.
-
error
private void error()
Throw exception if an attempt is made to change an immutable list.
-
-