|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.util.profiling.DataItem avrora.util.profiling.Proportion
This class represents the proportion of different items with respect to one another. For example, the proportion of cars, trucks, vans, etc on the highway.
Nested Class Summary | |
class |
Proportion.Share
Internal class that encapsulates both a counter and the fraction of the total that this named Share represents. |
Field Summary | |
protected java.util.Vector |
shares
|
protected int |
total
|
Fields inherited from class avrora.util.profiling.DataItem |
name |
Constructor Summary | |
Proportion(java.lang.String newname)
Public constructor that takes a string name. |
Method Summary | |
Proportion.Share |
createShare(java.lang.String name)
Register a counter object with this proportion. |
float |
getFractionForName(java.lang.String name)
Search for the counter with the specified name and report its proportion. |
Proportion.Share |
getShareForName(java.lang.String name)
Search for the counter with the specified string name and return it if it is registered. |
boolean |
hasData()
Return true if this proportion has any information available. |
void |
processData()
Do the computations and compute the proportions of each. |
Proportion.Share |
registerCount(java.lang.String str,
int count)
Register an integer count with this proportion object and return a Counter object. |
void |
textReport()
Generate a text report of the shares. |
Methods inherited from class avrora.util.profiling.DataItem |
getName, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.util.Vector shares
protected int total
Constructor Detail |
public Proportion(java.lang.String newname)
Method Detail |
public void textReport()
textReport
in class DataItem
public Proportion.Share createShare(java.lang.String name)
public Proportion.Share registerCount(java.lang.String str, int count)
public Proportion.Share getShareForName(java.lang.String name)
public float getFractionForName(java.lang.String name)
public void processData()
processData
in class DataItem
public boolean hasData()
hasData
in class DataItem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |