public class ImmutableSet<T> extends ImmutableCollection<T> implements Set<T>
array, emptyArray, length| Constructor and Description |
|---|
ImmutableSet(T[] array) |
ImmutableSet(T[] array,
int length) |
| Modifier and Type | Method and Description |
|---|---|
static <TT> ImmutableSet<TT> |
emptySet() |
boolean |
equals(Object other)
Compares the specified object with this set for equality.
|
int |
hashCode()
Returns the hash code value for this set.
|
static <TT> ImmutableSet<TT> |
setOf(TT[] array) |
static <TT> ImmutableSet<TT> |
setOf(TT[] array,
int length) |
contains, contains, iterator, toArray, toArrayadd, addAll, containsAll, remove, removeAll, retainAll, toStringclear, isEmpty, sizeclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streampublic ImmutableSet(T[] array, int length)
public ImmutableSet(T[] array)
public boolean equals(Object other)
true if the specified object is also a
set, the two sets have the same size, and every member of the specified set is contained in this set (or
equivalently, every member of this set is contained in the specified set). This definition ensures that the
equals method works properly across different implementations of the set interface.public int hashCode()
null element is defined to be zero. This ensures that
s1.equals(s2) implies that s1.hashCode() == s2.hashCode() for any two sets s1 and
s2, as required by the general contract of Object.hashCode().public static <TT> ImmutableSet<TT> emptySet()
public static <TT> ImmutableSet<TT> setOf(TT[] array)
public static <TT> ImmutableSet<TT> setOf(TT[] array, int length)
Copyright © 2021. All rights reserved.