Package net.sf.colossus.util
Class ValueRecorder
java.lang.Object
net.sf.colossus.util.ValueRecorder
- All Implemented Interfaces:
IValueRecorderItem
An integer value, along with a detailed record of how and why
the value has the value it has.
- Author:
- Romain Dolbeau
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Augment the value.void
add
(ValueRecorder v) Augment the value.int
getValue()
Get the value.boolean
isEmpty()
boolean
isReset()
void
Reset the value to a specific value.void
setScale
(float scale) toString()
Get the detailed explanations and final value as String.
-
Field Details
-
value
private int valueThe current value -
scale
private float scale -
desc
-
items
All the explanations and value changes
-
-
Constructor Details
-
ValueRecorder
public ValueRecorder() -
ValueRecorder
-
-
Method Details
-
isReset
public boolean isReset()- Specified by:
isReset
in interfaceIValueRecorderItem
-
add
Augment the value.- Parameters:
v
- By how much the value change.r
- The reason of the change.
-
add
Augment the value.- Parameters:
v
- By how much the value change, and why
-
resetTo
Reset the value to a specific value.- Parameters:
v
- The new value to use.r
- The reason of the change.
-
getValue
public int getValue()Get the value.- Specified by:
getValue
in interfaceIValueRecorderItem
- Returns:
- The current value.
-
setScale
public void setScale(float scale) -
isEmpty
public boolean isEmpty() -
getWhy
- Specified by:
getWhy
in interfaceIValueRecorderItem
-
getFull
- Specified by:
getFull
in interfaceIValueRecorderItem
-
toString
Get the detailed explanations and final value as String.
-