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 booleanadd(K e)booleanaddAll(java.util.Collection<? extends K> c)(package private) voidcheckMutable()voidclear()booleancontains(java.lang.Object o)booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object obj)inthashCode()booleanisEmpty()java.util.Iterator<K>iterator()booleanremove(java.lang.Object o)booleanremoveAll(java.util.Collection<?> c)booleanretainAll(java.util.Collection<?> c)intsize()java.lang.Object[]toArray()<T> T[]toArray(T[] a)java.lang.StringtoString()
-
-
-
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:
toStringin 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)
-
-