public class Counter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.Map |
counts
the counts
|
Constructor and Description |
---|
Counter()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
count(java.lang.Object counted)
Add count.
|
void |
count(java.lang.Object counted,
long countValue)
Adjust count by value
|
void |
dump(java.io.Writer writer)
Dump to output
|
long |
getCount(java.lang.Object counted)
Get the count
|
void |
removeCount(java.lang.Object counted)
Remove the count.
|
void |
resetAll()
Reset all the counters
|
void |
resetCount(java.lang.Object counted)
Reset the count for counted
|
java.lang.String |
toString() |
public void count(java.lang.Object counted)
counted
- public void count(java.lang.Object counted, long countValue)
counted
- the countedcountValue
- the count valuepublic void removeCount(java.lang.Object counted)
counted
- the countedpublic long getCount(java.lang.Object counted)
counted
- the countedpublic void dump(java.io.Writer writer) throws java.io.IOException
writer
- the writerjava.io.IOException
public void resetCount(java.lang.Object counted)
counted
- the countedpublic void resetAll()
public java.lang.String toString()
toString
in class java.lang.Object