Class BooleanObjGapList.ImmutableBooleanObjGapList
java.lang.Object
java.util.AbstractCollection<Boolean>
java.util.AbstractList<Boolean>
org.magicwerk.brownies.collections.IList<Boolean>
org.magicwerk.brownies.collections.primitive.BooleanObjGapList
org.magicwerk.brownies.collections.primitive.BooleanObjGapList.ImmutableBooleanObjGapList
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<Boolean>, Collection<Boolean>, List<Boolean>, RandomAccess, SequencedCollection<Boolean>, ICollection<Boolean>, IListable<Boolean>
- Enclosing class:
BooleanObjGapList
An immutable version of a GapList.
Note that the client cannot change the list,
but the content may change if the underlying list is changed.
- Version:
- $Id: BooleanObjGapList.java 2200 2014-03-21 10:46:29Z origo $
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class BooleanObjGapList
BooleanObjGapList.ImmutableBooleanObjGapListNested classes/interfaces inherited from class IList
IList.IListableFromArray<E>, IList.IListableFromCollection<E>, IList.IListableFromList<E>, IList.IListableFromMult<E> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longUID for serializationFields inherited from class BooleanObjGapList
listFields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrivate constructor used internally. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanHelper method for adding an element to the list.protected voiddoModify()This method is called internally before elements are allocated or freed.protected BooleandoRemove(int index) Helper method to remove an element.protected voiddoRemoveAll(int index, int len) Remove specified range of elements from list.protected BooleanSets an element at specified position.protected BooleanHelper method for setting an element in the list.private voiderror()Throw exception if an attempt is made to change an immutable list.Methods inherited from class BooleanObjGapList
addAll, addAll, addAll, addAll, addArray, addArray, binarySearch, capacity, clone, contains, containsAll, containsAny, copy, create, create, create, doAssign, doClone, doCreate, doEnsureCapacity, doGet, doGetAll, equals, get, getAll, getDefaultElem, hashCode, immutableList, indexOf, init, init, init, isEmpty, isReadOnly, lastIndexOf, move, remove, removeAll, removeAll, removeFirstOccurrence, removeLastOccurrence, retainAll, retainAll, setAll, setAll, setArray, size, sort, toArray, toArray, toArray, toPrimitive, toPrimitive, toPrimitive, toString, toWrapper, trimToSize, unmodifiableListMethods inherited from class IList
add, add, addArray, addArray, addFirst, addIfAbsent, addLast, addMult, addMult, asDeque, asIListable, binarySearch, checkIndex, checkIndexAdd, checkLength, checkLengths, checkNonNull, checkRange, clear, containsIf, copy, count, countIf, crop, descendingIterator, doAddAll, doClear, doCreateArray, doIndexOf, doIndexOfIf, doInitAll, doLastIndexOf, doLastIndexOfIf, doPutAll, doReplace, doRotate, drag, element, ensureCapacity, extract, extractIf, fill, filter, filterMap, flatMap, getAll, getDistinct, getFirst, getFirstOrNull, getIf, getLast, getLastOrNull, getSingle, getSingleOrNull, indexOf, indexOfIf, indexOfIf, initAll, initAll, initArray, initMult, iterator, lastIndexOf, lastIndexOfIf, lastIndexOfIf, listIterator, listIterator, map, mapFilter, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, put, putAll, putAll, putArray, putMult, remove, remove, remove, removeAll, removeFirst, removeIf, removeLast, replace, replaceAll, replaceAll, replaceArray, replaceMult, resize, retain, retainIf, reverse, reverse, rotate, rotate, set, setArray, setMult, sort, swap, toArray, toArray, toArray, transferCopy, transferMove, transferRemove, transferSwap, transform, transformedListMethods inherited from class AbstractList
removeRange, subListMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
replaceAll, reversed, spliterator, subList
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUID for serialization- See Also:
-
-
Constructor Details
-
ImmutableBooleanObjGapList
Private constructor used internally.- Parameters:
that- list to create an immutable view of
-
-
Method Details
-
doAdd
Description copied from class:IListHelper 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 classBooleanObjGapList- 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
Description copied from class:IListHelper 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 classBooleanObjGapList- Parameters:
index- index where element will be placedelem- element to set- Returns:
- old element which was at the position
-
doReSet
Description copied from class:IListSets 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 classBooleanObjGapList- Parameters:
index- index where element will be placedelem- element to set- Returns:
- old element which was at the position
-
doRemove
Description copied from class:IListHelper 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 classBooleanObjGapList- Parameters:
index- index of element to remove- Returns:
- removed element
-
doRemoveAll
protected void doRemoveAll(int index, int len) Description copied from class:IListRemove specified range of elements from list.- Overrides:
doRemoveAllin classBooleanObjGapList- Parameters:
index- index of first element to removelen- number of elements to remove
-
doModify
-
error
private void error()Throw exception if an attempt is made to change an immutable list.
-