@GenerateSubclass @Freezable(value=ReadOnlyCollection.class) public abstract class BackedFreezableCollection<E> extends net.digitalid.utility.rootclass.RootClass implements FreezableCollection<E>
collection that can be frozen.
It is recommended to use only ReadOnly or Immutable types for the elements.
The implementation is backed by an ordinary collection.BackedFreezableList,
BackedFreezableSet| Modifier and Type | Field and Description |
|---|---|
protected @Nonnull net.digitalid.utility.freezable.FreezableInterface |
freezable
Stores a reference to the underlying freezable.
|
| Modifier | Constructor and Description |
|---|---|
protected |
BackedFreezableCollection(@Nonnull net.digitalid.utility.freezable.FreezableInterface freezable,
@Nonnull Collection<E> collection) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E element) |
boolean |
addAll(@Nonnull Collection<? extends E> c) |
void |
clear() |
@Nonnull @NonFrozen FreezableCollection<E> |
clone() |
boolean |
equals(@Nullable Object object) |
@Nonnull FreezableIterator<E> |
freezableIterator()
Returns a freezable iterator over the elements in this collection.
|
@Nonnull @Frozen ReadOnlyCollection<E> |
freeze() |
int |
hashCode() |
boolean |
isFrozen() |
@Nonnull net.digitalid.utility.functional.iterators.ReadOnlyIterator<E> |
iterator() |
boolean |
remove(@Nullable Object object) |
boolean |
removeAll(@Nonnull Collection<?> c)
Removes the elements of the given collection from this collection.
|
boolean |
retainAll(@Nonnull Collection<?> c)
Retains the elements of the given collection and removes all other.
|
int |
size() |
@Nonnull String |
toString() |
static <E> @Nonnull BackedFreezableCollection<E> |
with(@Nonnull net.digitalid.utility.freezable.FreezableInterface freezable,
@Nonnull Collection<E> collection)
Returns a new freezable collection backed by the given freezable and collection.
|
finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, addAll, contains, containsAll, isEmpty, removeAll, removeAll, retainAll, retainAll, toArray, toArrayparallelStream, removeIf, spliterator, streamcontainsAlltoFreezableArray, toFreezableList, toFreezableMap, toFreezableSetaverage, 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, indexOf, instanceOf, intersect, isAscending, isDescending, isEmptyOrSingle, isOrdered, isSingle, isStrictlyAscending, isStrictlyDescending, join, join, join, join, join, join, join, join, lastIndexOf, 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, zipShortest@Pure @Capturable @Nonnull public static <E> @Nonnull BackedFreezableCollection<E> with(@Shared @Modified @Nonnull @Nonnull net.digitalid.utility.freezable.FreezableInterface freezable, @Captured @Nonnull @Nonnull Collection<E> collection)
@Pure public boolean isFrozen()
isFrozen in interface net.digitalid.utility.freezable.ReadOnlyInterface@Impure @NonFrozenRecipient @Nonnull @Frozen public @Nonnull @Frozen ReadOnlyCollection<E> freeze()
freeze in interface FreezableCollection<E>freeze in interface FreezableIterable<E>freeze in interface net.digitalid.utility.freezable.FreezableInterface@Pure @Capturable @Nonnull @NonFrozen public @Nonnull @NonFrozen FreezableCollection<E> clone()
clone in interface ReadOnlyCollection<E>clone in interface ReadOnlyIterable<E>clone in interface net.digitalid.utility.freezable.ReadOnlyInterfaceclone in class Object@Pure public int size()
size in interface Collection<E>size in interface net.digitalid.utility.functional.iterables.CollectionIterable<E>size in interface net.digitalid.utility.functional.iterables.FiniteIterable<E>size in interface net.digitalid.utility.interfaces.Countable@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>@Impure
@NonFrozenRecipient
public boolean add(@Captured
E element)
add in interface Collection<E>@Impure @NonFrozenRecipient public boolean addAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<? extends E> c)
addAll in interface Collection<E>@Impure @NonFrozenRecipient public boolean remove(@NonCaptured @Unmodified @Nullable @Nullable Object object)
remove in interface Collection<E>@Impure @NonFrozenRecipient public boolean removeAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<?> c)
FreezableCollectionremoveAll in interface Collection<E>removeAll in interface FreezableCollection<E>@Impure @NonFrozenRecipient public boolean retainAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<?> c)
FreezableCollectionretainAll in interface Collection<E>retainAll in interface FreezableCollection<E>@Impure @NonFrozenRecipient public void clear()
clear in interface Collection<E>@Pure public boolean equals(@Nullable @Nullable Object object)
equals in interface Collection<E>equals in interface net.digitalid.utility.rootclass.RootInterfaceequals in class net.digitalid.utility.rootclass.RootClassWithException<RuntimeException>@Pure public int hashCode()
hashCode in interface Collection<E>hashCode in interface net.digitalid.utility.rootclass.RootInterfacehashCode in class net.digitalid.utility.rootclass.RootClassWithException<RuntimeException>@Pure @Nonnull public @Nonnull String toString()
toString in interface net.digitalid.utility.rootclass.RootInterfacetoString in class net.digitalid.utility.rootclass.RootClassWithException<RuntimeException>Copyright © 2017. All rights reserved.