|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.presents.dobj.DSet<Stat>
com.threerings.stats.data.StatSet
public class StatSet
A distributed set containing Stat objects.
| Nested Class Summary | |
|---|---|
static interface |
StatSet.Container
An interface to be implemented by an entity that wishes to be notified when the contents of a stat set change. |
| Nested classes/interfaces inherited from class com.threerings.presents.dobj.DSet |
|---|
com.threerings.presents.dobj.DSet.Entry |
| Nested classes/interfaces inherited from interface com.threerings.io.Streamable |
|---|
com.threerings.io.Streamable.Closure |
| Constructor Summary | |
|---|---|
StatSet()
Creates a blank stat set. |
|
StatSet(Iterable<Stat> contents)
Creates a stat set with the specified contents. |
|
StatSet(Iterator<Stat> contents)
Creates a stat set with the specified contents. |
|
| Method Summary | ||
|---|---|---|
void |
addQuietly(Stat stat)
Don't call this method, it's only needed by some tricky business we do when preventing distributed object event generation for all but the bounty criteria related stats. |
|
|
addToSetStat(Stat.Type type,
T value)
Adds a value to a SetStat. |
|
void |
appendStat(Stat.Type type,
int value)
Appends an integer value to an IntArrayStat. |
|
|
containsValue(Stat.Type type,
T value)
Returns true if the specified SetStat contains the specified value, false
otherwise. |
|
int[] |
getIntArrayStat(Stat.Type type)
Returns the current value of the specified integer array statistic. |
|
int |
getIntStat(Stat.Type type)
Returns the current value of the specified integer statistic. |
|
int |
getMapValue(Stat.Type type,
String value)
Returns the value to which the specified string is mapped in a StringMapStat or zero
if the value has not been mapped. |
|
int |
getMaxIntStat(Stat.Type type)
Returns the maximum value by which the specified integer statistic has ever been incremented. |
|
int |
getSetStatSize(Stat.Type type)
Returns the current size of the specified SetStat statistic. |
|
void |
incrementMapStat(Stat.Type type,
String value,
int amount)
Increments a string value in a StringMapStat. |
|
void |
incrementStat(Stat.Type type,
int delta)
Increments an integer statistic in this set. |
|
void |
maxStat(Stat.Type type,
int value)
Sets an integer stat to the specified value, if it exceeds our existing recorded value. |
|
void |
setContainer(StatSet.Container container)
Wires this stat set up to a containing user object. |
|
void |
setStat(Stat.Type type,
int value)
Sets an integer statistic in this set. |
|
|
syncStat(StatModifier<T> modifier)
Updates a stat in this set, using the supplied StatModifier. |
|
| Methods inherited from class com.threerings.presents.dobj.DSet |
|---|
asSet, clone, compare, contains, containsKey, entries, get, iterator, newDSet, newDSet, readField__entries, readField__size, readObject, size, toArray, toArray, toString, typedClone, writeField__entries, writeField__size, writeObject |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public StatSet(Iterable<Stat> contents)
public StatSet(Iterator<Stat> contents)
public StatSet()
| Method Detail |
|---|
public void setContainer(StatSet.Container container)
public <T extends Stat> void syncStat(StatModifier<T> modifier)
public void setStat(Stat.Type type,
int value)
ClassCastException - thrown if the registered type of the specified stat is not an
IntStat.
public void maxStat(Stat.Type type,
int value)
ClassCastException - thrown if the registered type of the specified stat is not an
IntStat.
public void incrementStat(Stat.Type type,
int delta)
ClassCastException - thrown if the registered type of the specified stat is not an
IntStat.
public void appendStat(Stat.Type type,
int value)
IntArrayStat.
ClassCastException - thrown if the registered type of the specified stat is not an
IntArrayStat.
public <T> void addToSetStat(Stat.Type type,
T value)
SetStat.
ClassCastException - thrown if the registered type of the specified stat is not
an SetStat parameterized on the given type.
public void incrementMapStat(Stat.Type type,
String value,
int amount)
StringMapStat.
ClassCastException - thrown if the registered type of the specified stat is not an
StringMapStat.public int getIntStat(Stat.Type type)
ClassCastException - thrown if the registered type of the specified stat is not an
IntStat.public int getMaxIntStat(Stat.Type type)
ClassCastException - thrown if the registered type of the specified stat is not an
MaxIntStat.public int[] getIntArrayStat(Stat.Type type)
ClassCastException - thrown if the registered type of the specified stat is not an
IntArrayStat.public int getSetStatSize(Stat.Type type)
ClassCastException - thrown if the registered type of the specified stat is not an
SetStat.
public <T> boolean containsValue(Stat.Type type,
T value)
SetStat contains the specified value, false
otherwise.
public int getMapValue(Stat.Type type,
String value)
StringMapStat or zero
if the value has not been mapped.
public void addQuietly(Stat stat)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||