| java.lang.Object de.schlund.pfixxml.util.RefCountingCollection
RefCountingCollection | public class RefCountingCollection implements Collection<E>(Code) | | A collection that stores a counter for each object. adding the same Object more than once will
increase the counter, removing it will decrease the counter until it reaches 0, in that case the
whole entry will be removed from the map. This implementation is backed by a HashMap, use
SortedRefCountingCollection for an implementation that uses a TreeMap.
Note that the iterator that is given will iterate over the distinct elements, regardless of their
cardinality. The Iterator is implemented by the class RefCountingCollectionIterator, which
features the additional method remove(int count) which works like removing from the collection
itself, while the usual Iterator.remove() will remove the whole element, regardles of cardinality
to be consistent with next() and hasNext().
Created: Wed Nov 16 00:18:45 2005
author: Jens Lautenbacher version: 1.0 |
RefCountingCollection | public RefCountingCollection()(Code) | | |
RefCountingCollection | public RefCountingCollection(Collection<? extends E> collection)(Code) | | |
add | final public boolean add(E object, int cardinality)(Code) | | |
add | final public boolean add(E object)(Code) | | |
clear | final public void clear()(Code) | | |
getCardinality | final public int getCardinality(Object object)(Code) | | |
hashCode | final public int hashCode()(Code) | | |
init | final protected void init(boolean sorted)(Code) | | |
isEmpty | final public boolean isEmpty()(Code) | | |
isInternalMapEqualToMap | final protected boolean isInternalMapEqualToMap(Map, ?> map)(Code) | | |
remove | final public boolean remove(Object object, int cardinality)(Code) | | |
removeElement | final public boolean removeElement(Object object)(Code) | | |
size | final public int size()(Code) | | |
toArray | final public T[] toArray(T[] array)(Code) | | |
|
|