|
||||||||||
| 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 MonitoredCollectionpublic void removeCollectionListener(CollectionListener l)
removeCollectionListener in interface MonitoredCollectionpublic int size()
size in interface Collectionsize in interface Setpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface Setpublic boolean contains(Object o)
contains in interface Collectioncontains in interface Setpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Setpublic Object[] toArray()
toArray in interface CollectiontoArray in interface Setpublic Object[] toArray(Object[] array)
toArray in interface CollectiontoArray in interface Setpublic boolean add(Object o)
add in interface Collectionadd in interface Setpublic boolean remove(Object o)
remove in interface Collectionremove in interface Setpublic boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface Setpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface Setpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface Setpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface Setpublic void clear()
clear in interface Collectionclear in interface Setpublic boolean equals(Object o)
equals in interface Collectionequals in interface Setequals in class Objectpublic String toString()
toString in class Objectprotected 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 | |||||||||