@GenerateSubclass @Freezable(value=ReadOnlyList.class) public abstract class FreezableArrayList<E> extends ArrayList<E> implements FreezableList<E>
ArrayList and makes it freezable.
It is recommended to use only ReadOnly or Immutable types for the elements.modCount| Modifier | Constructor and Description |
|---|---|
protected |
FreezableArrayList() |
protected |
FreezableArrayList(@NonNegative int initialCapacity) |
protected |
FreezableArrayList(@NonNegative int initialCapacity,
@Nonnull Iterable<? extends E> iterable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E element) |
void |
add(@IndexForInsertion int index,
E element) |
boolean |
addAll(@Nonnull Collection<? extends E> collection) |
boolean |
addAll(@IndexForInsertion int index,
@Nonnull Collection<? extends E> collection) |
void |
clear() |
@Nonnull @NonFrozen FreezableArrayList<E> |
clone() |
void |
ensureCapacity(@NonNegative int minCapacity) |
@Nonnull FreezableIterator<E> |
freezableIterator()
Returns a freezable iterator over the elements in this collection.
|
@Nonnull @Frozen ReadOnlyList<E> |
freeze() |
E |
get(@Index int index) |
boolean |
isFrozen() |
@Nonnull net.digitalid.utility.functional.iterators.ReadOnlyIterator<E> |
iterator() |
@Nonnull net.digitalid.utility.functional.iterators.ReadOnlyListIterator<E> |
listIterator() |
@Nonnull net.digitalid.utility.functional.iterators.ReadOnlyListIterator<E> |
listIterator(@IndexForInsertion int index) |
E |
remove(@Index int index) |
boolean |
remove(@Nullable Object object) |
boolean |
removeAll(@Nonnull Collection<?> collection)
Removes the elements of the given collection from this collection.
|
protected void |
removeRange(@Index int fromIndex,
@IndexForInsertion int toIndex) |
boolean |
retainAll(@Nonnull Collection<?> collection)
Retains the elements of the given collection and removes all other.
|
E |
set(@Index int index,
E element) |
@Nonnull FreezableList<E> |
subList(@Index int fromIndex,
@IndexForInsertion int toIndex) |
void |
trimToSize() |
static <E> @Nonnull @NonFrozen FreezableArrayList<E> |
withElement(E element)
Returns a new freezable array list with the given element.
|
static <E> @Nonnull @NonFrozen FreezableArrayList<E> |
withElements(E... elements)
Returns a new freezable array list with the given elements or null if the given array is null.
|
static <E> @NonFrozen FreezableArrayList<E> |
withElementsOf(Collection<? extends E> collection)
Returns a new freezable array list with the elements of the given collection or null if the given collection is null.
|
static <E> @NonFrozen FreezableArrayList<E> |
withElementsOf(net.digitalid.utility.functional.iterables.FiniteIterable<? extends E> iterable)
Returns a new freezable array list with the elements of the given iterable or null if the given iterable is null.
|
static <E> @NonFrozen FreezableArrayList<E> |
withElementsOf(FreezableCollection<? extends E> collection)
Returns a new freezable array list with the elements of the given freezable collection or null if the given collection is null.
|
static <E> @Nonnull @NonFrozen FreezableArrayList<E> |
withInitialCapacity(@NonNegative int initialCapacity)
Returns a new freezable array list with the given initial capacity.
|
static <E> @Nonnull @NonFrozen FreezableArrayList<E> |
withNoElements()
Returns a new freezable array list with no elements.
|
contains, forEach, indexOf, isEmpty, lastIndexOf, removeIf, replaceAll, size, sort, spliterator, toArray, toArrayequals, hashCodecontainsAll, toStringfinalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, containsAll, indexOf, isEmpty, lastIndexOf, toArray, toArraywithequals, hashCode, replaceAll, size, sort, spliteratoraddAll, addAll, removeAll, removeAll, retainAll, retainAllparallelStream, removeIf, streamcontainsAlltoFreezableArray, toFreezableList, toFreezableMap, toFreezableSetsize, sizeaverage, collect, combine, combine, containsAll, containsDuplicates, containsNull, count, distinct, doForEach, equals, evaluate, exclude, filter, filterNot, filterNulls, findFirst, findFirst, findLast, findLast, findUnique, flatten, flattenAll, flattenOne, getFirst, getFirst, getFirstOrNull, getLast, getLast, getLastOrNull, groupBy, instanceOf, intersect, isAscending, isDescending, isEmptyOrSingle, isOrdered, isSingle, isStrictlyAscending, isStrictlyDescending, join, join, join, join, join, join, join, join, map, matchAll, matchAny, matchNone, max, max, max, max, min, min, min, min, of, of, reduce, reduce, repeated, reversed, skip, sorted, sorted, sumAsDouble, sumAsLong, toGenericArray, toList, toMap, toSet, zipLongest, zipShortestextract, hasSize, limit, sizeAtLeast, sizeAtMost, zipLongest, zipShortestprotected FreezableArrayList()
protected FreezableArrayList(@NonNegative
@NonNegative int initialCapacity)
@Pure @Capturable @Nonnull @NonFrozen public static <E> @Nonnull @NonFrozen FreezableArrayList<E> withNoElements()
@Pure @Capturable @Nonnull @NonFrozen public static <E> @Nonnull @NonFrozen FreezableArrayList<E> withElement(@Captured E element)
@Pure @Capturable @Nonnull @NonFrozen public static <E> @Nonnull @NonFrozen FreezableArrayList<E> withInitialCapacity(@NonNegative @NonNegative int initialCapacity)
@Pure @SafeVarargs @Capturable @Nonnull @NonFrozen public static <E> @Nonnull @NonFrozen FreezableArrayList<E> withElements(@NonCaptured @Unmodified E... elements)
@Pure @Capturable @NonFrozen public static <E> @NonFrozen FreezableArrayList<E> withElementsOf(net.digitalid.utility.functional.iterables.FiniteIterable<? extends E> iterable)
@Pure @Capturable @NonFrozen public static <E> @NonFrozen FreezableArrayList<E> withElementsOf(@NonCaptured @Unmodified Collection<? extends E> collection)
@Pure @Capturable @NonFrozen public static <E> @NonFrozen FreezableArrayList<E> withElementsOf(@NonCaptured @Unmodified FreezableCollection<? extends E> collection)
@Pure public boolean isFrozen()
isFrozen in interface net.digitalid.utility.freezable.ReadOnlyInterface@Impure @NonFrozenRecipient @Nonnull @Frozen public @Nonnull @Frozen ReadOnlyList<E> freeze()
freeze in interface FreezableCollection<E>freeze in interface FreezableIterable<E>freeze in interface FreezableList<E>freeze in interface net.digitalid.utility.freezable.FreezableInterface@Pure @Capturable @Nonnull @NonFrozen public @Nonnull @NonFrozen FreezableArrayList<E> clone()
clone in interface ReadOnlyCollection<E>clone in interface ReadOnlyIterable<E>clone in interface ReadOnlyList<E>clone in interface net.digitalid.utility.freezable.ReadOnlyInterfaceclone in class ArrayList<E>@Pure @Capturable @Nonnull public @Nonnull net.digitalid.utility.functional.iterators.ReadOnlyIterator<E> iterator()
@Pure @Capturable @Nonnull public @Nonnull FreezableIterator<E> freezableIterator()
FreezableCollectionfreezableIterator in interface FreezableCollection<E>@Pure @NonCapturable public E get(@Index @Index int index)
@Pure @Capturable @Nonnull public @Nonnull net.digitalid.utility.functional.iterators.ReadOnlyListIterator<E> listIterator()
listIterator in interface List<E>listIterator in interface ReadOnlyList<E>listIterator in class ArrayList<E>List.listIterator()@Pure @Capturable @Nonnull public @Nonnull net.digitalid.utility.functional.iterators.ReadOnlyListIterator<E> listIterator(@IndexForInsertion @IndexForInsertion int index)
listIterator in interface List<E>listIterator in interface ReadOnlyList<E>listIterator in class ArrayList<E>List.listIterator(int)@Pure @NonCapturable @Nonnull public @Nonnull FreezableList<E> subList(@Index @Index int fromIndex, @IndexForInsertion @IndexForInsertion int toIndex)
subList in interface List<E>subList in interface FreezableList<E>subList in interface ReadOnlyList<E>subList in class ArrayList<E>List.subList(int, int)@Impure
@NonFrozenRecipient
public boolean add(@Captured
E element)
@Impure
@NonFrozenRecipient
public void add(@IndexForInsertion
@IndexForInsertion int index,
@Captured
E element)
@Impure @NonFrozenRecipient public boolean addAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<? extends E> collection)
@Impure
@NonFrozenRecipient
public boolean addAll(@IndexForInsertion
@IndexForInsertion int index,
@NonCaptured @Unmodified @Nonnull
@Nonnull Collection<? extends E> collection)
@Impure @NonFrozenRecipient @Capturable public E remove(@Index @Index int index)
@Impure @NonFrozenRecipient public boolean remove(@NonCaptured @Unmodified @Nullable @Nullable Object object)
@Impure
@NonFrozenRecipient
protected void removeRange(@Index
@Index int fromIndex,
@IndexForInsertion
@IndexForInsertion int toIndex)
removeRange in class ArrayList<E>@Impure @NonFrozenRecipient public boolean removeAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<?> collection)
FreezableCollectionremoveAll in interface Collection<E>removeAll in interface List<E>removeAll in interface FreezableCollection<E>removeAll in interface FreezableList<E>removeAll in class ArrayList<E>@Impure @NonFrozenRecipient public boolean retainAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<?> collection)
FreezableCollectionretainAll in interface Collection<E>retainAll in interface List<E>retainAll in interface FreezableCollection<E>retainAll in interface FreezableList<E>retainAll in class ArrayList<E>@Impure @NonFrozenRecipient public void clear()
@Impure @NonFrozenRecipient @Capturable public E set(@Index @Index int index, @Captured E element)
@Impure
@NonFrozenRecipient
public void ensureCapacity(@NonNegative
@NonNegative int minCapacity)
ensureCapacity in class ArrayList<E>@Impure @NonFrozenRecipient public void trimToSize()
trimToSize in class ArrayList<E>Copyright © 2017. All rights reserved.