public class DoubleParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends AbstractValuePluginParameter<G,A,R,java.lang.Double>
PluginParameter that holds a double value.| Modifier and Type | Field and Description |
|---|---|
static @NotNull java.lang.String |
PARAMETER_TYPE
The string representation of this parameter type.
|
| Constructor and Description |
|---|
DoubleParameter()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
double |
getMax()
Returns the maximal allowed value.
|
double |
getMin()
Returns the minimal allowed value.
|
@NotNull java.lang.String |
getParameterType()
Returns the parameter type name.
|
@NotNull java.lang.String |
getStringValue()
Returns the string representation of the current value of the parameter.
|
void |
setMax(double max)
Sets the maximal allowed value.
|
void |
setMin(double min)
Sets the minimal allowed value.
|
boolean |
setStringValue(@NotNull java.lang.String stringValue)
Sets the parameter value from string representation.
|
void |
setValue(@NotNull java.lang.Double value)
Updates the parameter value.
|
<T> T |
visit(@NotNull PluginParameterVisitor<G,A,R,T> visitor)
Calls the
visit() function for this parameter type. |
getValue, getValueOrNulladdPluginParameterListener, changed, getDescription, getName, removePluginParameterListener, setDescription, setName@NotNull public static final @NotNull java.lang.String PARAMETER_TYPE
@NotNull
public <T> T visit(@NotNull
@NotNull PluginParameterVisitor<G,A,R,T> visitor)
PluginParametervisit() function for this parameter type.T - the visitor-specific type of the return valuevisitor - the visitor to callpublic boolean setStringValue(@NotNull
@NotNull java.lang.String stringValue)
PluginParameterstringValue - the string representation of the value to settrue if the value was accepted or false if the
value was not changed because the new value is invalidpublic void setValue(@NotNull
@NotNull java.lang.Double value)
AbstractValuePluginParametersetValue in class AbstractValuePluginParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,java.lang.Double>value - the new value@NotNull public @NotNull java.lang.String getParameterType()
PluginParameter@NotNull public @NotNull java.lang.String getStringValue()
PluginParameterpublic double getMax()
public void setMax(double max)
max - the maximal allowed valuepublic double getMin()
public void setMin(double min)
min - the minimal allowed value