com.threerings.stats.data
Class MaxIntStat
java.lang.Object
com.threerings.stats.data.Stat
com.threerings.stats.data.IntStat
com.threerings.stats.data.MaxIntStat
- All Implemented Interfaces:
- com.threerings.io.Streamable, com.threerings.presents.dobj.DSet.Entry, Cloneable
public class MaxIntStat
- extends IntStat
Extends the IntStat by maintaining a maximum value which is updated every time a value
is accumulated to the stat. Thus we track an accumulating value as well as the largest amount by
which it has ever accumulated.
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
com.threerings.io.Streamable.Closure |
|
Method Summary |
int |
getMaxValue()
Returns the maximum value every accumulated to this integer statistic. |
boolean |
increment(int delta)
Increments this statistic by the specified delta value. |
void |
persistTo(com.threerings.io.ObjectOutputStream out,
Stat.AuxDataSource aux)
Serializes this instance for storage in the item database. |
void |
unpersistFrom(com.threerings.io.ObjectInputStream in,
Stat.AuxDataSource aux)
Unserializes this item from data obtained from the item database. |
String |
valueToString()
Derived statistics must override this method and render their value to a string. |
| Methods inherited from class com.threerings.stats.data.Stat |
clone, getCode, getKey, getModCount, getType, getType, initType, isModified, setModCount, setModified, toString |
MaxIntStat
public MaxIntStat()
getMaxValue
public int getMaxValue()
- Returns the maximum value every accumulated to this integer statistic.
increment
public boolean increment(int delta)
- Description copied from class:
IntStat
- Increments this statistic by the specified delta value.
- Overrides:
increment in class IntStat
- Returns:
- true if the stat was modified, false if not.
valueToString
public String valueToString()
- Description copied from class:
Stat
- Derived statistics must override this method and render their value to a string. Used by
Stat.toString() and to display the value in game.
- Overrides:
valueToString in class IntStat
persistTo
public void persistTo(com.threerings.io.ObjectOutputStream out,
Stat.AuxDataSource aux)
throws IOException
- Description copied from class:
Stat
- Serializes this instance for storage in the item database. Derived classes must override
this method to implement persistence.
- Overrides:
persistTo in class IntStat
- Throws:
IOException
unpersistFrom
public void unpersistFrom(com.threerings.io.ObjectInputStream in,
Stat.AuxDataSource aux)
throws IOException,
ClassNotFoundException
- Description copied from class:
Stat
- Unserializes this item from data obtained from the item database. Derived classes must
override this method to implement persistence.
- Overrides:
unpersistFrom in class IntStat
- Throws:
IOException
ClassNotFoundException
Copyright © 2011. All Rights Reserved.