|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--mark.nlp.data.HashBag
A Bag implemented with a hash. Appropriate when one does not know the possible elements of the bag ahead of time (or the number of possibilities is prohibitively large compared to what will actually happen).
| Field Summary | |
protected java.util.HashMap |
fCounts
|
protected int |
fNum
|
| Constructor Summary | |
HashBag()
|
|
| Method Summary | |
void |
inc(java.lang.Object o,
double cnt)
|
java.util.Iterator |
iterator()
Returns an iterator over the object types. |
double |
num()
Returns the number of object occurrences in the bag. |
double |
num(java.lang.Object o)
Returns the number of object type o occurrences in the bag. |
int |
numTypes()
Returns the number of object types with non-zero occurrences. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.HashMap fCounts
protected int fNum
| Constructor Detail |
public HashBag()
| Method Detail |
public void inc(java.lang.Object o,
double cnt)
public int numTypes()
Bag
numTypes in interface Bagpublic java.util.Iterator iterator()
Bag
iterator in interface Bagpublic double num(java.lang.Object o)
Bag
num in interface Bago - the object.
public double num()
Bag
num in interface Bag
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||