com.threerings.stats.data
Class StringSetStat

java.lang.Object
  extended by com.threerings.stats.data.Stat
      extended by com.threerings.stats.data.SetStat<String>
          extended by com.threerings.stats.data.StringSetStat
All Implemented Interfaces:
com.threerings.io.Streamable, com.threerings.presents.dobj.DSet.Entry, Cloneable
Direct Known Subclasses:
ByteStringSetStat, IntStringSetStat, ShortStringSetStat

public abstract class StringSetStat
extends SetStat<String>

Used to track a statistic comprised of a set of strings.


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
com.threerings.io.Streamable.Closure
 
Constructor Summary
StringSetStat()
           
 
Method Summary
 boolean add(String key)
          Adds the specified string to this set.
 boolean contains(String key)
          Returns true if the specified string is contained in this set.
 int size()
          Returns the number of Strings in this set.
 String[] values()
          Returns the values in this set.
 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, getCode, getKey, getModCount, getType, getType, initType, isModified, persistTo, setModCount, setModified, toString, unpersistFrom
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringSetStat

public StringSetStat()
Method Detail

size

public int size()
Returns the number of Strings in this set.

Specified by:
size in class SetStat<String>

contains

public boolean contains(String key)
Returns true if the specified string is contained in this set.

Specified by:
contains in class SetStat<String>

add

public boolean add(String key)
Adds the specified string to this set.

Specified by:
add in class SetStat<String>
Returns:
true if the string was newly added, false if it was already contained in the set.

values

public String[] values()
Returns the values in this set. Do not modify the returned array.


valueToString

public String valueToString()
Description copied from class: Stat
Derived statistics must override this method and render their value to a string. Used by Stat.toString() and to display the value in game.

Specified by:
valueToString in class Stat


Copyright © 2011. All Rights Reserved.