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 TypeMethodDescriptionbooleanbooleanaddAll(Collection<? extends E> c) voidclear()booleanbooleancontainsAll(Collection<?> c) booleanisEmpty()iterator()booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) intsize()Object[]toArray()<T> T[]toArray(T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods 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:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceSet<E>
-
addAll
-
retainAll
-
removeAll
-
clear
public void clear()
-