public class ValueRecorder extends java.lang.Object implements IValueRecorderItem
| Modifier and Type | Class and Description |
|---|---|
private class |
ValueRecorder.TrivialValueRecorderItem |
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
desc |
private java.util.List<IValueRecorderItem> |
items
All the explanations and value changes
|
private float |
scale |
private int |
value
The current value
|
| Constructor and Description |
|---|
ValueRecorder() |
ValueRecorder(java.lang.String desc) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int v,
java.lang.String r)
Augment the value.
|
void |
add(ValueRecorder v)
Augment the value.
|
java.lang.String |
getFull(java.lang.String prefix) |
int |
getValue()
Get the value.
|
java.lang.String |
getWhy(java.lang.String prefix) |
boolean |
isEmpty() |
boolean |
isReset() |
void |
resetTo(int v,
java.lang.String r)
Reset the value to a specific value.
|
void |
setScale(float scale) |
java.lang.String |
toString()
Get the detailed explanations and final value as String.
|
private int value
private float scale
private final java.lang.String desc
private final java.util.List<IValueRecorderItem> items
public ValueRecorder()
public ValueRecorder(java.lang.String desc)
public boolean isReset()
isReset in interface IValueRecorderItempublic void add(int v,
java.lang.String r)
v - By how much the value change.r - The reason of the change.public void add(ValueRecorder v)
v - By how much the value change, and whypublic void resetTo(int v,
java.lang.String r)
v - The new value to use.r - The reason of the change.public int getValue()
getValue in interface IValueRecorderItempublic void setScale(float scale)
public boolean isEmpty()
public java.lang.String getWhy(java.lang.String prefix)
getWhy in interface IValueRecorderItempublic java.lang.String getFull(java.lang.String prefix)
getFull in interface IValueRecorderItempublic java.lang.String toString()
toString in class java.lang.Object