Package org.infinispan.util
Class ReadOnlyCollectionAsSet<T>
- java.lang.Object
-
- org.infinispan.util.ReadOnlyCollectionAsSet<T>
-
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,Set<T>
public class ReadOnlyCollectionAsSet<T> extends Object implements Set<T>
Assumes that the delegate collection already contains unique elements.
-
-
Constructor Summary
Constructors Constructor Description ReadOnlyCollectionAsSet(Collection<? extends T> delegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(T t)
boolean
addAll(Collection<? extends T> c)
void
clear()
boolean
contains(Object o)
boolean
containsAll(Collection<?> c)
boolean
isEmpty()
Iterator<T>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
Object[]
toArray()
<T1> T1[]
toArray(T1[] 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
-
-
-
-
Constructor Detail
-
ReadOnlyCollectionAsSet
public ReadOnlyCollectionAsSet(Collection<? extends T> delegate)
-
-
Method Detail
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object o)
-
toArray
public Object[] toArray()
-
toArray
public <T1> T1[] toArray(T1[] a)
-
add
public boolean add(T t)
-
remove
public boolean remove(Object o)
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceSet<T>
-
addAll
public boolean addAll(Collection<? extends T> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
removeAll
public boolean removeAll(Collection<?> c)
-
-