|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.data.CountingBag
public class CountingBag
A HashMap which can hold multiple copies of objects. Tracks the number of objects.
| Constructor Summary | |
|---|---|
CountingBag()
|
|
| Method Summary | |
|---|---|
int |
add(java.lang.Object ob)
Adds an object. |
int |
add(java.lang.Object ob,
int quantity)
Adds an object several times. |
int |
count(java.lang.Object ob)
Get # of instances. |
java.util.Map |
getCounts()
|
void |
setCounts(java.util.Map newCounts)
|
java.util.Iterator |
uniqueElements()
Get unique elements. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CountingBag()
| Method Detail |
|---|
public int add(java.lang.Object ob)
public int add(java.lang.Object ob,
int quantity)
public int count(java.lang.Object ob)
public java.util.Iterator uniqueElements()
public java.util.Map getCounts()
public void setCounts(java.util.Map newCounts)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||