|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.dtfj.analyzer.util.CountedName
public class CountedName
A simple mutable Integer with attached name. Note that it is arranged for sorting into increasing
count order not into name order. The original aim was to keep track of the number of instances of a given
class. The ArrayCount subclass keeps track of the number of array instances and in addition records the
max and min element count.
See ArrayCount
Constructor Summary | |
---|---|
CountedName(java.lang.String name)
Typically the name of the class we're counting |
Method Summary | |
---|---|
void |
addBytes(long b)
Add the given number of bytes to the current total |
int |
compareTo(java.lang.Object other)
Compare based on the counts so we can sort the most frequent |
long |
getBytes()
How many bytes do these occupy |
int |
getCount()
How many of these have we seen ? |
java.lang.String |
getName()
Return the name of this count |
void |
increment()
Add one more to the count |
java.lang.String |
toString()
The default is the name and the count value - not the bytes |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public CountedName(java.lang.String name)
name
- Method Detail |
---|
public void increment()
public void addBytes(long b)
b
- public int getCount()
public long getBytes()
public java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |