|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectceleboss.data.ChangableValue
This class represents a value that changes over time. It records a float representation for the current value. It also holds the sign of the first derivative of the changing value, hence the value can be increasing, decreasing or in a no change state.
| Field Summary | |
static short |
DECREASING
Constant for an decreasing value |
static short |
INCREASING
Constant for an increasing value |
static short |
NOCHANGE
Constant for an unchanging value |
| Constructor Summary | |
ChangableValue()
Create a new changable value with default value |
|
ChangableValue(float initalValue)
Create a new changable value with the intial value. |
|
| Method Summary | |
int |
compareTo(java.lang.Object arg0)
Compare this vlaue with another object. |
boolean |
equals(java.lang.Object other)
Compare this value to another. |
long |
getChangedOn()
When did the value change |
java.text.NumberFormat |
getDefaultFormat()
Format to use for toString method. |
int |
getIncreasing()
Is this value increasing or decreasing |
static long |
getMaximumAge()
Get the maximum age values are allowed before they are rest |
double |
getOldValue()
Get the numeric old value as a double. |
float |
getValue()
Get the numeric value as a double. |
int |
hashCode()
|
void |
resetValue()
This method resets the old value to the current value. |
static void |
setFormat(java.text.NumberFormat format)
Set the default formatting for currency value. |
static void |
setMaximumAge(long maximumAge)
Set teh maximum age than values are allowed before they get reset as not moving |
boolean |
setValue(float newValue)
Attempts to update teh vlaue of this changable. |
java.lang.String |
toString()
Get the current value as a string. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final short DECREASING
public static final short INCREASING
public static final short NOCHANGE
| Constructor Detail |
public ChangableValue()
public ChangableValue(float initalValue)
initalValue - Starting value| Method Detail |
public static long getMaximumAge()
public static void setFormat(java.text.NumberFormat format)
format - Number format to use.toString()public static void setMaximumAge(long maximumAge)
maximumAge - The maximumAge to set in minutespublic int compareTo(java.lang.Object arg0)
compareTo in interface java.lang.Comparablearg0 - Object to compare against.
Comparable.compareTo(java.lang.Object)public boolean equals(java.lang.Object other)
other - The other object to compare.
Object.equals(java.lang.Object)public long getChangedOn()
public java.text.NumberFormat getDefaultFormat()
public int getIncreasing()
public double getOldValue()
public float getValue()
public int hashCode()
Object.hashCode()public void resetValue()
public boolean setValue(float newValue)
newValue - New value.
public java.lang.String toString()
Object.toString(),
NumberFormat.getCurrencyInstance()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||