|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.collections.CountedSet
public class CountedSet
A set that counts add's and remove's on values. If a value is added N times, then it must be removed N times to be deleted from the set.
Constructor Summary | |
---|---|
CountedSet()
|
|
CountedSet(Collection data)
|
|
CountedSet(Map dataMap)
Constructor to allow users to get CountedSet to use their Map implementation. |
Method Summary | |
---|---|
boolean |
add(Object o)
|
boolean |
addAll(Collection c)
|
void |
addCollectionListener(CollectionListener l)
|
void |
clear()
Clears the set regardless of value counts. |
boolean |
contains(Object o)
|
boolean |
containsAll(Collection c)
|
protected static Integer |
decrement(Integer i)
Return an Integer minus 1. |
boolean |
equals(Object o)
|
protected static Integer |
increment(Integer i)
Return an Integer plus 1. |
boolean |
isEmpty()
|
Iterator |
iterator()
|
boolean |
remove(Object o)
|
boolean |
removeAll(Collection c)
|
void |
removeCollectionListener(CollectionListener l)
|
boolean |
retainAll(Collection c)
|
int |
size()
|
Object[] |
toArray()
|
Object[] |
toArray(Object[] array)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
---|
hashCode |
Constructor Detail |
---|
public CountedSet()
public CountedSet(Map dataMap)
The reason behind this constructor is so that users can implement Maps with they own comparator implementations rather than relying on HashMap's and TreeMap's implementations.
public CountedSet(Collection data)
Method Detail |
---|
public void addCollectionListener(CollectionListener l)
addCollectionListener
in interface MonitoredCollection
public void removeCollectionListener(CollectionListener l)
removeCollectionListener
in interface MonitoredCollection
public int size()
size
in interface Collection
size
in interface Set
public boolean isEmpty()
isEmpty
in interface Collection
isEmpty
in interface Set
public boolean contains(Object o)
contains
in interface Collection
contains
in interface Set
public Iterator iterator()
iterator
in interface Iterable
iterator
in interface Collection
iterator
in interface Set
public Object[] toArray()
toArray
in interface Collection
toArray
in interface Set
public Object[] toArray(Object[] array)
toArray
in interface Collection
toArray
in interface Set
public boolean add(Object o)
add
in interface Collection
add
in interface Set
public boolean remove(Object o)
remove
in interface Collection
remove
in interface Set
public boolean containsAll(Collection c)
containsAll
in interface Collection
containsAll
in interface Set
public boolean addAll(Collection c)
addAll
in interface Collection
addAll
in interface Set
public boolean retainAll(Collection c)
retainAll
in interface Collection
retainAll
in interface Set
public boolean removeAll(Collection c)
removeAll
in interface Collection
removeAll
in interface Set
public void clear()
clear
in interface Collection
clear
in interface Set
public boolean equals(Object o)
equals
in interface Collection
equals
in interface Set
equals
in class Object
public String toString()
toString
in class Object
protected static Integer increment(Integer i)
protected static Integer decrement(Integer i)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |