public class AverageLogger extends Object
| Constructor and Description |
|---|
AverageLogger() |
| Modifier and Type | Method and Description |
|---|---|
static void |
activate()
Activates the logger.
|
static void |
deactivate()
Deactivates the logger.
|
static void |
increaseCount(String label)
Increases the number of instances (i.e the divisor for the average) of
the variable with the given label by 1.
|
static void |
increaseCountBy(String label,
int increase)
Increases the number of instances (i.e the divisor for the average) of
the variable with the given label by the given value.
|
static void |
increaseValue(String label)
Increases the value of the variable with the given label by 1.
|
static void |
increaseValueBy(String label,
int increase)
Increases the value of the variable with the given label by the given
amount.
|
static void |
printAveragesAsError()
Computes the averages and prints them via
System.err. |
static void |
resetAndActivate()
Resets the counts of the logger and activates it.
|
static void |
setDefaultCount(int newDefaultCount)
Sets the default number of instances for variables where the count has
not been set via
increaseCount/increaseCountBy. |
public static void activate()
activate and resetAndActivate have no effect. The
logger is deactivated by default. Note that activating the logger may
performance for all classes that use it.public static void deactivate()
activate and resetAndActivate have no effect. The
logger is deactivated by default. Note that activating the logger may
performance for all classes that use it.public static void resetAndActivate()
activate and
resresetAndActivateet have no effect. The logger is deactivated
by default. Note that activating the logger may influence performance
for all classes that use it.public static void increaseValue(String label)
label - public static void increaseValueBy(String label, int increase)
label - increase - public static void increaseCount(String label)
label - public static void increaseCountBy(String label, int increase)
label - increase - public static void setDefaultCount(int newDefaultCount)
increaseCount/increaseCountBy.newDefaultCount - public static void printAveragesAsError()
System.err.Copyright © 2017. All rights reserved.