|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.stats.data.Stat
com.threerings.stats.data.IntStat
public class IntStat
Used to track a single integer statistic.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.stats.data.Stat |
|---|
Stat.AuxDataSource, Stat.Type |
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
Streamable.Closure |
| Field Summary | |
|---|---|
protected int |
_value
Contains the integer value of this statistic. |
| Fields inherited from class com.threerings.stats.data.Stat |
|---|
_codeToType, _crc, _modCount, _modified, _type |
| Constructor Summary | |
|---|---|
IntStat()
|
|
| Method Summary | |
|---|---|
int |
getValue()
Returns the value of this integer statistic. |
boolean |
increment(int delta)
Increments this statistic by the specified delta value. |
void |
persistTo(ObjectOutputStream out,
Stat.AuxDataSource aux)
Serializes this instance for storage in the item database. |
boolean |
setValue(int value)
Sets this statistic's value to the specified value. |
void |
unpersistFrom(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, crc32, getCode, getKey, getModCount, getType, getType, initType, isModified, setModCount, setModified, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int _value
| Constructor Detail |
|---|
public IntStat()
| Method Detail |
|---|
public int getValue()
public boolean setValue(int value)
public boolean increment(int delta)
public String valueToString()
StatStat.toString() and to display the value in game.
valueToString in class Stat
public void persistTo(ObjectOutputStream out,
Stat.AuxDataSource aux)
throws IOException
Stat
persistTo in class StatIOException
public void unpersistFrom(ObjectInputStream in,
Stat.AuxDataSource aux)
throws IOException,
ClassNotFoundException
Stat
unpersistFrom in class StatIOException
ClassNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||