T - The statistic value typepublic abstract class StatWithValueType<T> extends Stat<T>
definition| Modifier | Constructor and Description |
|---|---|
protected |
StatWithValueType(StatDefinition definition)
Creates an instance without registering it with an owning group.
|
protected |
StatWithValueType(StatGroup group,
StatDefinition definition)
Creates an instance that registers itself with an owning group.
|
| Modifier and Type | Method and Description |
|---|---|
<S> S |
getForType(Class<S> requestedType)
Returns the value of the statistic as an instance of the specified type,
or
null if the value is a different type. |
abstract Class<T> |
getValueType()
Returns the type of the value returned by the
BaseStat.get() method. |
add, computeInterval, copy, copyAndAdd, copyAndClear, getDefinition, negate, set, toString, toStringVerboseclear, get, getFormattedValue, isNotSetprotected StatWithValueType(StatGroup group, StatDefinition definition)
group - the owning groupdefinition - the definition of the statisticprotected StatWithValueType(StatDefinition definition)
definition - the definition of the statisticpublic abstract Class<T> getValueType()
BaseStat.get() method.public <S> S getForType(Class<S> requestedType)
null if the value is a different type.S - the desired value typerequestedType - the class of the desired value typenullCopyright © 2024. All rights reserved.