@GenerateBuilder @GenerateSubclass @Freezable(value=ReadOnlySet.class) public abstract class FreezableHashSet<E> extends HashSet<E> implements FreezableSet<E>
HashSet and makes it freezable.
It is recommended to use only ReadOnly or Immutable types for the elements.| Modifier | Constructor and Description |
|---|---|
protected |
FreezableHashSet(@NonNegative int initialCapacity,
@Positive float loadFactor) |
protected |
FreezableHashSet(@NonNegative int initialCapacity,
@Nonnull Iterable<? extends E> iterable) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E element) |
boolean |
addAll(@Nonnull Collection<? extends E> collection) |
void |
clear() |
@Nonnull @NonFrozen FreezableHashSet<E> |
clone() |
@Nonnull FreezableIterator<E> |
freezableIterator()
Returns a freezable iterator over the elements in this collection.
|
@Nonnull @Frozen ReadOnlySet<E> |
freeze() |
boolean |
isFrozen() |
@Nonnull net.digitalid.utility.functional.iterators.ReadOnlyIterator<E> |
iterator() |
boolean |
remove(@Nullable Object object) |
boolean |
removeAll(@Nonnull Collection<?> collection)
Removes the elements of the given collection from this collection.
|
boolean |
retainAll(@Nonnull Collection<?> collection)
Retains the elements of the given collection and removes all other.
|
@Nonnull String |
toString() |
static <E> @Nonnull @NonFrozen FreezableHashSet<E> |
withElement(E element)
Returns a new freezable hash set with the given element.
|
static <E> @NonFrozen FreezableHashSet<E> |
withElements(E... elements)
Returns a new freezable hash set with the given elements or null if the given array is null.
|
static <E> @NonFrozen FreezableHashSet<E> |
withElementsOf(Collection<? extends E> collection)
Returns a new freezable hash set with the elements of the given collection or null if the given collection is null.
|
static <E> @NonFrozen FreezableHashSet<E> |
withElementsOf(net.digitalid.utility.functional.iterables.FiniteIterable<? extends E> iterable)
Returns a new freezable hash set with the elements of the given iterable or null if the given iterable is null.
|
static <E> @NonFrozen FreezableHashSet<E> |
withElementsOf(FreezableCollection<? extends E> collection)
Returns a new freezable hash set with the elements of the given freezable collection or null if the given collection is null.
|
contains, isEmpty, size, spliteratorequals, hashCodecontainsAll, toArray, toArrayequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, containsAll, isEmpty, toArray, toArrayequals, hashCode, size, 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, 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@Recover
protected FreezableHashSet(@NonNegative @Default(value="16")
@NonNegative int initialCapacity,
@Positive @Default(value="0.75f")
@Positive float loadFactor)
@Pure @Capturable @Nonnull @NonFrozen public static <E> @Nonnull @NonFrozen FreezableHashSet<E> withElement(@Captured E element)
@Pure @SafeVarargs @Capturable @NonFrozen public static <E> @NonFrozen FreezableHashSet<E> withElements(@NonCaptured @Unmodified E... elements)
@Pure @Capturable @NonFrozen public static <E> @NonFrozen FreezableHashSet<E> withElementsOf(net.digitalid.utility.functional.iterables.FiniteIterable<? extends E> iterable)
@Pure @Capturable @NonFrozen public static <E> @NonFrozen FreezableHashSet<E> withElementsOf(@NonCaptured @Unmodified Collection<? extends E> collection)
@Pure @Capturable @NonFrozen public static <E> @NonFrozen FreezableHashSet<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 ReadOnlySet<E> freeze()
freeze in interface FreezableCollection<E>freeze in interface FreezableIterable<E>freeze in interface FreezableSet<E>freeze in interface net.digitalid.utility.freezable.FreezableInterface@Pure @Capturable @Nonnull @NonFrozen public @Nonnull @NonFrozen FreezableHashSet<E> clone()
clone in interface ReadOnlyCollection<E>clone in interface ReadOnlyIterable<E>clone in interface ReadOnlySet<E>clone in interface net.digitalid.utility.freezable.ReadOnlyInterfaceclone in class HashSet<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>@Impure
@NonFrozenRecipient
public boolean add(@Captured
E element)
@Impure @NonFrozenRecipient public boolean addAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<? extends E> collection)
addAll in interface Collection<E>addAll in interface Set<E>addAll in class AbstractCollection<E>@Impure @NonFrozenRecipient public boolean remove(@NonCaptured @Unmodified @Nullable @Nullable Object object)
@Impure @NonFrozenRecipient public boolean removeAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<?> collection)
FreezableCollectionremoveAll in interface Collection<E>removeAll in interface Set<E>removeAll in interface FreezableCollection<E>removeAll in interface FreezableSet<E>removeAll in class AbstractSet<E>@Impure @NonFrozenRecipient public boolean retainAll(@NonCaptured @Unmodified @Nonnull @Nonnull Collection<?> collection)
FreezableCollectionretainAll in interface Collection<E>retainAll in interface Set<E>retainAll in interface FreezableCollection<E>retainAll in interface FreezableSet<E>retainAll in class AbstractCollection<E>@Impure @NonFrozenRecipient public void clear()
Copyright © 2017. All rights reserved.