|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.stats.data.Stat
public abstract class Stat
A base class for persistent statistics tracked on a per-player basis (some for a single game, others for all time).
| Nested Class Summary | |
|---|---|
static interface |
Stat.AuxDataSource
Provides auxilliary information to statistics during the persisting process. |
static interface |
Stat.Type
Defines the various per-player tracked statistics. |
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
com.threerings.io.Streamable.Closure |
| Constructor Summary | |
|---|---|
Stat()
|
|
| Method Summary | |
|---|---|
Stat |
clone()
|
int |
getCode()
Returns the integer code to which this statistic's name maps. |
String |
getKey()
|
byte |
getModCount()
Returns the modification count of this Stat when it was loaded from the repository. |
Stat.Type |
getType()
Returns the type of this statistic. |
static Stat.Type |
getType(int code)
Maps a Stat.Type's code code back to a Stat.Type instance. |
static int |
initType(Stat.Type type,
Stat prototype)
Used by the Stat.Type implementation to map itself to an integer code. |
boolean |
isModified()
Returns true if the supplied statistic has been modified since it was loaded from the repository. |
abstract void |
persistTo(com.threerings.io.ObjectOutputStream out,
Stat.AuxDataSource aux)
Serializes this instance for storage in the item database. |
void |
setModCount(byte modCount)
Sets the modification count for this Stat. |
void |
setModified(boolean modified)
Forces this stat to consider itself modified. |
String |
toString()
|
abstract void |
unpersistFrom(com.threerings.io.ObjectInputStream in,
Stat.AuxDataSource aux)
Unserializes this item from data obtained from the item database. |
abstract String |
valueToString()
Derived statistics must override this method and render their value to a string. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Stat()
| Method Detail |
|---|
public static Stat.Type getType(int code)
Stat.Type's code code back to a Stat.Type instance.
public static int initType(Stat.Type type,
Stat prototype)
Stat.Type implementation to map itself to an integer code.
public Stat.Type getType()
public int getCode()
public boolean isModified()
public void setModified(boolean modified)
public byte getModCount()
public void setModCount(byte modCount)
public abstract void persistTo(com.threerings.io.ObjectOutputStream out,
Stat.AuxDataSource aux)
throws IOException
IOException
public abstract void unpersistFrom(com.threerings.io.ObjectInputStream in,
Stat.AuxDataSource aux)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundExceptionpublic String toString()
toString in class Objectpublic abstract String valueToString()
toString() and to display the value in game.
public String getKey()
getKey in interface com.threerings.presents.dobj.DSet.Entrypublic Stat clone()
clone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||