Class DoubleObjGapList.ImmutableDoubleObjGapList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- org.magicwerk.brownies.collections.IList<java.lang.Double>
-
- org.magicwerk.brownies.collections.primitive.DoubleObjGapList
-
- org.magicwerk.brownies.collections.primitive.DoubleObjGapList.ImmutableDoubleObjGapList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<java.lang.Double>
,java.util.Collection<java.lang.Double>
,java.util.List<java.lang.Double>
,java.util.RandomAccess
,ICollection<java.lang.Double>
,IListable<java.lang.Double>
- Enclosing class:
- DoubleObjGapList
protected static class DoubleObjGapList.ImmutableDoubleObjGapList extends DoubleObjGapList
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.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.magicwerk.brownies.collections.primitive.DoubleObjGapList
DoubleObjGapList.ImmutableDoubleObjGapList
-
Nested classes/interfaces inherited from class org.magicwerk.brownies.collections.IList
IList.IListableFromArray<E>, IList.IListableFromCollection<E>, IList.IListableFromList<E>, IList.IListableFromMult<E>
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
UID for serialization-
Fields inherited from class org.magicwerk.brownies.collections.primitive.DoubleObjGapList
list
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ImmutableDoubleObjGapList(DoubleObjGapList that)
Private constructor used internally.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
doAdd(int index, java.lang.Double elem)
Helper method for adding an element to the list.protected void
doModify()
This method is called internally before elements are allocated or freed.protected java.lang.Double
doRemove(int index)
Helper method to remove an element.protected void
doRemoveAll(int index, int len)
Remove specified range of elements from list.protected java.lang.Double
doReSet(int index, java.lang.Double elem)
Sets an element at specified position.protected java.lang.Double
doSet(int index, java.lang.Double 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.DoubleObjGapList
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, unmodifiableList
-
Methods inherited from class org.magicwerk.brownies.collections.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, transformedList
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
UID for serialization- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ImmutableDoubleObjGapList
protected ImmutableDoubleObjGapList(DoubleObjGapList that)
Private constructor used internally.- Parameters:
that
- list to create an immutable view of
-
-
Method Detail
-
doAdd
protected boolean doAdd(int index, java.lang.Double elem)
Description copied from class:IList
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 classDoubleObjGapList
- 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 java.lang.Double doSet(int index, java.lang.Double elem)
Description copied from class:IList
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 classDoubleObjGapList
- Parameters:
index
- index where element will be placedelem
- element to set- Returns:
- old element which was at the position
-
doReSet
protected java.lang.Double doReSet(int index, java.lang.Double elem)
Description copied from class:IList
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 classDoubleObjGapList
- Parameters:
index
- index where element will be placedelem
- element to set- Returns:
- old element which was at the position
-
doRemove
protected java.lang.Double doRemove(int index)
Description copied from class:IList
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 classDoubleObjGapList
- Parameters:
index
- index of element to remove- Returns:
- removed element
-
doRemoveAll
protected void doRemoveAll(int index, int len)
Description copied from class:IList
Remove specified range of elements from list.- Overrides:
doRemoveAll
in classDoubleObjGapList
- Parameters:
index
- index of first element to removelen
- number of elements to remove
-
doModify
protected void doModify()
Description copied from class:IList
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.
-
-