Package com.landawn.abacus.util
Class ImmutableSet<E>
java.lang.Object
java.util.AbstractCollection<E>
com.landawn.abacus.util.ImmutableCollection<E>
com.landawn.abacus.util.ImmutableSet<E>
- Type Parameters:
E
-
- All Implemented Interfaces:
Immutable
,Iterable<E>
,Collection<E>
,Set<E>
- Direct Known Subclasses:
ImmutableSortedSet
,Iterables.SetView
- Since:
- 0.8
- Author:
- Haiyang Li
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> ImmutableSet.Builder<E>
builder()
static <E> ImmutableSet<E>
copyOf
(Collection<? extends E> set) static <E> ImmutableSet<E>
empty()
static <T> ImmutableSet<T>
just
(T e) static <E> ImmutableSet<E>
of
(E... a) static <T> ImmutableSet<T>
of
(T e1) static <T> ImmutableSet<T>
of
(T e1, T e2) static <T> ImmutableSet<T>
of
(T e1, T e2, T e3) static <T> ImmutableSet<T>
of
(T e1, T e2, T e3, T e4) static <T> ImmutableSet<T>
of
(T e1, T e2, T e3, T e4, T e5) static <T> ImmutableSet<T>
of
(T e1, T e2, T e3, T e4, T e5, T e6) static <T> ImmutableSet<T>
of
(T e1, T e2, T e3, T e4, T e5, T e6, T e7) static <E> ImmutableCollection<E>
wrap
(Collection<? extends E> c) Deprecated.static <E> ImmutableSet<E>
Deprecated.the ImmutableSet may be modified through the specifiedset
Methods inherited from class com.landawn.abacus.util.ImmutableCollection
add, addAll, clear, contains, equals, hashCode, iterator, remove, removeAll, removeIf, retainAll, size, toArray, toArray, toString
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Method Details
-
empty
- Type Parameters:
E
-- Returns:
-
just
- Type Parameters:
T
-- Parameters:
e
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-- Returns:
-
of
- Type Parameters:
T
-- Parameters:
e1
-e2
-e3
-e4
-e5
-e6
-e7
-- Returns:
-
of
- Type Parameters:
E
-- Parameters:
a
-- Returns:
-
copyOf
- Type Parameters:
E
-- Parameters:
set
-- Returns:
-
wrap
Deprecated.the ImmutableSet may be modified through the specifiedset
- Type Parameters:
E
-- Parameters:
set
-- Returns:
- an
ImmutableSet
backed by the specifiedset
-
wrap
@Deprecated public static <E> ImmutableCollection<E> wrap(Collection<? extends E> c) throws UnsupportedOperationException Deprecated.throwsUnsupportedOperationException
- Type Parameters:
E
-- Parameters:
c
-- Returns:
- Throws:
UnsupportedOperationException
-
builder
- Type Parameters:
E
-- Returns:
-
UnsupportedOperationException