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
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> ImmutableSet<E>
copyOf
(Collection<? extends E> set) static <E> ImmutableSet<E>
empty()
static <E> ImmutableSet<E>
just
(E e) static <E> ImmutableSet<E>
of
(E e) static <E> ImmutableSet<E>
of
(E... a) static <E> ImmutableCollection<E>
of
(Collection<? extends E> c) Deprecated.static <E> ImmutableSet<E>
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:
E
-- Parameters:
e
-- Returns:
-
of
- Type Parameters:
E
-- Parameters:
e
-- Returns:
-
of
- Type Parameters:
E
-- Parameters:
a
-- Returns:
-
of
- Type Parameters:
E
-- Parameters:
set
- the elements in thisSet
are shared by the returned ImmutableSet.- Returns:
-
copyOf
- Type Parameters:
E
-- Parameters:
set
-- Returns:
-
of
@Deprecated public static <E> ImmutableCollection<E> of(Collection<? extends E> c) throws UnsupportedOperationException Deprecated.throwsUnsupportedOperationException
- Type Parameters:
E
-- Parameters:
c
-- Returns:
- Throws:
UnsupportedOperationException
-
UnsupportedOperationException