Package com.ibm.icu.impl
Class CollectionSet<E>
java.lang.Object
com.ibm.icu.impl.CollectionSet<E>
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
A wrapper around java.util.Collection that implements java.util.Set. This class keeps a pointer to the
Collection and does not persist any data on its own.
Useful when you need a Set but creating a HashSet is too expensive.
IMPORTANT: The elements of the Collection *must* be unique! This class does not check.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> c) void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
equals, hashCode, spliterator
-
Field Details
-
data
-
-
Constructor Details
-
CollectionSet
-
-
Method Details
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
-
addAll
-
retainAll
-
removeAll
-
clear
public void clear()
-