Package com.ibm.icu.impl
Class CollectionSet<E>
- java.lang.Object
-
- com.ibm.icu.impl.CollectionSet<E>
-
- All Implemented Interfaces:
java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
public class CollectionSet<E> extends java.lang.Object implements java.util.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.
-
-
Constructor Summary
Constructors Constructor Description CollectionSet(java.util.Collection<E> data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(E e)
boolean
addAll(java.util.Collection<? extends E> c)
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
isEmpty()
java.util.Iterator<E>
iterator()
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
int
size()
java.lang.Object[]
toArray()
<T> T[]
toArray(T[] a)
-
-
-
Field Detail
-
data
private final java.util.Collection<E> data
-
-
Constructor Detail
-
CollectionSet
public CollectionSet(java.util.Collection<E> data)
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(java.lang.Object o)
-
iterator
public java.util.Iterator<E> iterator()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
add
public boolean add(E e)
-
remove
public boolean remove(java.lang.Object o)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
addAll
public boolean addAll(java.util.Collection<? extends E> c)
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
-