Package net.sf.gridarta.plugin.parameter
Class DoubleParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.plugin.parameter.AbstractPluginParameter<G,A,R,V>
-
- net.sf.gridarta.plugin.parameter.AbstractValuePluginParameter<G,A,R,java.lang.Double>
-
- net.sf.gridarta.plugin.parameter.DoubleParameter<G,A,R>
-
- All Implemented Interfaces:
PluginParameter<G,A,R,java.lang.Double>
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>
APluginParameterthat holds a double value.
-
-
Field Summary
Fields Modifier and Type Field Description static @NotNull java.lang.StringPARAMETER_TYPEThe string representation of this parameter type.
-
Constructor Summary
Constructors Constructor Description DoubleParameter()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetMax()Returns the maximal allowed value.doublegetMin()Returns the minimal allowed value.@NotNull java.lang.StringgetParameterType()Returns the parameter type name.@NotNull java.lang.StringgetStringValue()Returns the string representation of the current value of the parameter.voidsetMax(double max)Sets the maximal allowed value.voidsetMin(double min)Sets the minimal allowed value.booleansetStringValue(@NotNull java.lang.String stringValue)Sets the parameter value from string representation.voidsetValue(@NotNull java.lang.Double value)Updates the parameter value.<T> Tvisit(@NotNull PluginParameterVisitor<G,A,R,T> visitor)Calls thevisit()function for this parameter type.-
Methods inherited from class net.sf.gridarta.plugin.parameter.AbstractValuePluginParameter
getValue, getValueOrNull
-
Methods inherited from class net.sf.gridarta.plugin.parameter.AbstractPluginParameter
addPluginParameterListener, changed, getDescription, getName, removePluginParameterListener, setDescription, setName
-
-
-
-
Method Detail
-
visit
@NotNull public <T> T visit(@NotNull @NotNull PluginParameterVisitor<G,A,R,T> visitor)Description copied from interface:PluginParameterCalls thevisit()function for this parameter type.- Type Parameters:
T- the visitor-specific type of the return value- Parameters:
visitor- the visitor to call- Returns:
- a visitor-specific return value
-
setStringValue
public boolean setStringValue(@NotNull @NotNull java.lang.String stringValue)Description copied from interface:PluginParameterSets the parameter value from string representation.- Parameters:
stringValue- the string representation of the value to set- Returns:
trueif the value was accepted orfalseif the value was not changed because the new value is invalid
-
setValue
public void setValue(@NotNull @NotNull java.lang.Double value)Description copied from class:AbstractValuePluginParameterUpdates the parameter value.- Overrides:
setValuein classAbstractValuePluginParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,java.lang.Double>- Parameters:
value- the new value
-
getParameterType
@NotNull public @NotNull java.lang.String getParameterType()
Description copied from interface:PluginParameterReturns the parameter type name.- Returns:
- the parameter type name
-
getStringValue
@NotNull public @NotNull java.lang.String getStringValue()
Description copied from interface:PluginParameterReturns the string representation of the current value of the parameter.- Returns:
- the string representation of the value
-
getMax
public double getMax()
Returns the maximal allowed value.- Returns:
- the maximal allowed value
-
setMax
public void setMax(double max)
Sets the maximal allowed value.- Parameters:
max- the maximal allowed value
-
getMin
public double getMin()
Returns the minimal allowed value.- Returns:
- the minimal allowed value
-
setMin
public void setMin(double min)
Sets the minimal allowed value.- Parameters:
min- the minimal allowed value
-
-