|
|||||||||
| 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.SetStat<Integer>
com.threerings.stats.data.IntSetStat
public class IntSetStat
Used to track a statistic comprised of a bounded set of integers.
| 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 StreamableArrayIntSet |
_intSet
|
protected int |
_maxSize
|
protected static int |
MAX_MAX_SIZE
|
| Fields inherited from class com.threerings.stats.data.Stat |
|---|
_codeToType, _crc, _modCount, _modified, _type |
| Constructor Summary | |
|---|---|
IntSetStat()
Constructs a new IntSetStat that will store up to 255 ints. |
|
IntSetStat(int maxSize)
Constructs a new IntSetStat that will store up to maxSize ints. |
|
| Method Summary | |
|---|---|
boolean |
add(Integer key)
Adds the specified int to this set. |
boolean |
contains(Integer key)
Returns true if the specified int is contained in this set. |
void |
persistTo(ObjectOutputStream out,
Stat.AuxDataSource aux)
Serializes this instance for storage in the item database. |
int |
size()
Returns the number of values stored in the set. |
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 _maxSize
protected StreamableArrayIntSet _intSet
protected static final int MAX_MAX_SIZE
| Constructor Detail |
|---|
public IntSetStat()
public IntSetStat(int maxSize)
maxSize - the maximum number of ints to store in the IntSetStat. Must be <= 255.| Method Detail |
|---|
public int size()
size in class SetStat<Integer>public boolean contains(Integer key)
contains in class SetStat<Integer>public boolean add(Integer key)
add in class SetStat<Integer>
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
ClassNotFoundExceptionpublic String valueToString()
StatStat.toString() and to display the value in game.
valueToString in class Stat
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||