com.threerings.stats.data
Class ByteByteStringMapStat

java.lang.Object
  extended by com.threerings.stats.data.Stat
      extended by com.threerings.stats.data.StringMapStat
          extended by com.threerings.stats.data.ByteByteStringMapStat
All Implemented Interfaces:
Streamable, DSet.Entry, Cloneable

public class ByteByteStringMapStat
extends StringMapStat

Maps up to 127 string values to integers in the range 0 - 127.


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
 
Fields inherited from class com.threerings.stats.data.StringMapStat
_keys, _values
 
Fields inherited from class com.threerings.stats.data.Stat
_codeToType, _crc, _modCount, _modified, _type
 
Constructor Summary
ByteByteStringMapStat()
           
 
Method Summary
protected  int getMaxValue()
          Returns the maximum value to which we'll allow our strings to map (to avoid overflowing our underlying data types and to avoid accumulating forever when we don't really care).
 void persistTo(ObjectOutputStream out, Stat.AuxDataSource aux)
          Serializes this instance for storage in the item database.
 void unpersistFrom(ObjectInputStream in, Stat.AuxDataSource aux)
          Unserializes this item from data obtained from the item database.
 
Methods inherited from class com.threerings.stats.data.StringMapStat
containsKey, get, getOrCreateEntry, increment, put, valueToString
 
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
 

Constructor Detail

ByteByteStringMapStat

public ByteByteStringMapStat()
Method Detail

persistTo

public void persistTo(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.

Specified by:
persistTo in class Stat
Throws:
IOException

unpersistFrom

public void unpersistFrom(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.

Specified by:
unpersistFrom in class Stat
Throws:
IOException
ClassNotFoundException

getMaxValue

protected int getMaxValue()
Description copied from class: StringMapStat
Returns the maximum value to which we'll allow our strings to map (to avoid overflowing our underlying data types and to avoid accumulating forever when we don't really care).

Specified by:
getMaxValue in class StringMapStat