|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractSet<E>
net.sf.molae.pipe.hash.SetBasedBitSet<E>
public class SetBasedBitSet<E>
A set based on a set and a bit set that determines which elements are contained in the set. If a lot of subsets of the same base sets are needed and each element in the base set has a unique hash code, subsets can be implemented using a bit map, where a bit is set if the element with the corresponding hash code is contained in the subset.
| Constructor Summary | |
|---|---|
SetBasedBitSet(Collection<E> base)
Constructs a SetBasedBitSet object. |
|
| Method Summary | |
|---|---|
boolean |
add(E o)
Ensures that this collection contains the specified element (optional operation). |
boolean |
addAll(Collection<? extends E> c)
Adds all of the elements in the specified collection to this collection (optional operation). |
void |
clear()
Removes all of the elements from this collection (optional operation). |
boolean |
contains(Object o)
|
boolean |
containsAll(Collection<?> c)
Returns true if this collection contains all of the elements in the specified collection. |
protected Collection<E> |
getBase()
Returns the underlying base object. |
protected BigInteger |
getMask()
Returns the underlying bit set. |
boolean |
isEmpty()
|
Iterator<E> |
iterator()
Returns an iterator over the elements contained in this collection. |
boolean |
remove(Object o)
|
boolean |
removeAll(Collection<?> c)
Removes from this collection all of its elements that are contained in the specified collection (optional operation). |
boolean |
retainAll(Collection<?> c)
Retains only the elements in this collection that are contained in the specified collection (optional operation). |
int |
size()
|
| Methods inherited from class java.util.AbstractSet |
|---|
equals, hashCode |
| Methods inherited from class java.util.AbstractCollection |
|---|
toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
toArray, toArray |
| Constructor Detail |
|---|
public SetBasedBitSet(Collection<E> base)
base - the base set of which this set is a subset.| Method Detail |
|---|
protected Collection<E> getBase()
protected BigInteger getMask()
public int size()
size in interface Collection<E>size in interface Set<E>size in class AbstractCollection<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>isEmpty in class AbstractCollection<E>public boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>contains in class AbstractCollection<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface Set<E>iterator in class AbstractCollection<E>public boolean add(E o)
add in interface Collection<E>add in interface Set<E>add in class AbstractCollection<E>o - element whose presence in this collection is to be ensured.
IllegalArgumentException - if the specified element is not in the
base set of this set.public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>remove in class AbstractCollection<E>public boolean containsAll(Collection<?> c)
AbstractSet is used.
containsAll in interface Collection<E>containsAll in interface Set<E>containsAll in class AbstractCollection<E>c - collection to be checked for containment in this collection.
public boolean addAll(Collection<? extends E> c)
AbstractSet is used.
addAll in interface Collection<E>addAll in interface Set<E>addAll in class AbstractCollection<E>c - collection whose elements are to be added to this collection.
public boolean retainAll(Collection<?> c)
AbstractSet is used.
retainAll in interface Collection<E>retainAll in interface Set<E>retainAll in class AbstractCollection<E>c - elements to be retained in this collection.
public boolean removeAll(Collection<?> c)
AbstractSet is used.
removeAll in interface Collection<E>removeAll in interface Set<E>removeAll in class AbstractSet<E>c - elements to be removed from this collection.
public void clear()
clear in interface Collection<E>clear in interface Set<E>clear in class AbstractCollection<E>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||