Class CollectionAsSet<K>
java.lang.Object
org.magicwerk.brownies.collections.CollectionAsSet<K>
- All Implemented Interfaces:
Iterable<K>
,Collection<K>
,Set<K>
- Direct Known Subclasses:
KeyCollectionAsSet
Implements a Set based on a Collection.
It supports both mutable and immutable sets.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends K> c) (package private) void
void
clear()
boolean
boolean
containsAll
(Collection<?> c) boolean
int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> c) boolean
retainAll
(Collection<?> c) int
size()
Object[]
toArray()
<T> T[]
toArray
(T[] a) toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
spliterator
-
Field Details
-
coll
Collection<K> coll -
immutable
boolean immutable
-
-
Constructor Details
-
CollectionAsSet
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
toArray
-
toArray
public <T> T[] toArray(T[] a) -
containsAll
- Specified by:
containsAll
in interfaceCollection<K>
- Specified by:
containsAll
in interfaceSet<K>
-
iterator
-
checkMutable
void checkMutable() -
add
-
addAll
-
clear
public void clear() -
remove
-
removeAll
-
retainAll
-