|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvisidia.stats.Statistics
public class Statistics
This class consists in a collection of objects associated with their occurrence.
Constructor Summary | |
---|---|
Statistics()
Instantiates a new statistics. |
Method Summary | |
---|---|
void |
add(java.lang.Object o)
Increments the current value of the Bag corresponding to the object 'o'. |
void |
add(java.lang.Object o,
long occurrences)
Add the current value of the Bag corresponding to the object 'o' with the value 'occurrences'. |
void |
addStatListener(StatListener listener)
Adds a stat listener. |
java.util.Hashtable<java.lang.Object,java.lang.Long> |
asHashTable()
As hash table. |
long |
getOccurrencesOf(java.lang.Object o)
Gets the occurrences of object. |
StatListener[] |
getStatListeners()
Gets the stat listeners. |
java.util.Set<java.lang.Object> |
keySet()
Key set. |
void |
max(java.lang.Object o,
long occurrences)
Compare the current value of the Bag corresponding to the object 'o' with the value 'occurrences' and replace the value of the Bag with the maximum of both values. |
void |
min(java.lang.Object o,
long occurrences)
Compare the current value of the Bag corresponding to the object 'o' with the value 'occurrences' and replace the value of the Bag with the minimum of both values. |
void |
removeStatListener(StatListener listener)
Removes a stat listener. |
void |
replace(java.lang.Object o,
long occurrences)
Replace the current value of the Bag corresponding to the object 'o' with the value 'occurrences'. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Statistics()
Method Detail |
---|
public long getOccurrencesOf(java.lang.Object o)
o
- the object
public void add(java.lang.Object o, long occurrences)
o
- the objectoccurrences
- the occurrencespublic void add(java.lang.Object o)
o
- the objectpublic void min(java.lang.Object o, long occurrences)
o
- the objectoccurrences
- the occurrencespublic void max(java.lang.Object o, long occurrences)
o
- the objectoccurrences
- the occurrencespublic void replace(java.lang.Object o, long occurrences)
o
- the objectoccurrences
- the occurrencespublic java.util.Hashtable<java.lang.Object,java.lang.Long> asHashTable()
public java.util.Set<java.lang.Object> keySet()
public void addStatListener(StatListener listener)
listener
- the listenerpublic void removeStatListener(StatListener listener)
listener
- the listenerpublic StatListener[] getStatListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |