|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.util.ValueRecorder
public class ValueRecorder
An integer value, along with a detailed record of how and why the value has the value it has.
Nested Class Summary | |
---|---|
private class |
ValueRecorder.TrivialValueRecorderItem
|
Field Summary | |
---|---|
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 Summary | |
---|---|
ValueRecorder()
|
|
ValueRecorder(java.lang.String desc)
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int value
private float scale
private final java.lang.String desc
private final java.util.List<IValueRecorderItem> items
Constructor Detail |
---|
public ValueRecorder()
public ValueRecorder(java.lang.String desc)
Method Detail |
---|
public boolean isReset()
isReset
in interface IValueRecorderItem
public 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 whyr
- The reason of the change.public 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 IValueRecorderItem
public void setScale(float scale)
public boolean isEmpty()
public java.lang.String getWhy(java.lang.String prefix)
getWhy
in interface IValueRecorderItem
public java.lang.String getFull(java.lang.String prefix)
getFull
in interface IValueRecorderItem
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |