Class CollectionAsSet<K>
- java.lang.Object
-
- org.magicwerk.brownies.collections.CollectionAsSet<K>
-
- All Implemented Interfaces:
java.lang.Iterable<K>
,java.util.Collection<K>
,java.util.Set<K>
- Direct Known Subclasses:
KeyCollectionAsSet
public class CollectionAsSet<K> extends java.lang.Object implements java.util.Set<K>
Implements a Set based on a Collection. It supports both mutable and immutable sets.
-
-
Constructor Summary
Constructors Constructor Description CollectionAsSet(java.util.Collection<K> coll, boolean immutable, boolean check)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(K e)
boolean
addAll(java.util.Collection<? extends K> c)
(package private) void
checkMutable()
void
clear()
boolean
contains(java.lang.Object o)
boolean
containsAll(java.util.Collection<?> c)
boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
isEmpty()
java.util.Iterator<K>
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)
java.lang.String
toString()
-
-
-
Field Detail
-
coll
java.util.Collection<K> coll
-
immutable
boolean immutable
-
-
Constructor Detail
-
CollectionAsSet
public CollectionAsSet(java.util.Collection<K> coll, boolean immutable, boolean check)
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object obj)
-
hashCode
public int hashCode()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(java.lang.Object o)
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <T> T[] toArray(T[] a)
-
containsAll
public boolean containsAll(java.util.Collection<?> c)
-
iterator
public java.util.Iterator<K> iterator()
-
checkMutable
void checkMutable()
-
add
public boolean add(K e)
-
addAll
public boolean addAll(java.util.Collection<? extends K> c)
-
clear
public void clear()
-
remove
public boolean remove(java.lang.Object o)
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
-
-