Class FunctionalGenerator
java.lang.Object
wbs.utils.util.providers.generator.num.DoubleGenerator
wbs.utils.util.providers.generator.num.FunctionalGenerator
- All Implemented Interfaces:
Provider,Refreshable
- Direct Known Subclasses:
AdditionGenerator,MaxGenerator,MinGenerator,MultiplicationGenerator
A type of DoubleGenerator that takes some number of NumProviders and
operates on them to determine the value
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFunctionalGenerator(double... args) FunctionalGenerator(List<Double> args) FunctionalGenerator(org.bukkit.configuration.ConfigurationSection section, WbsSettings settings, String directory) Create this generator from a ConfigurationSection, logging errors in the given settingsFunctionalGenerator(org.bukkit.configuration.ConfigurationSection section, WbsSettings settings, String directory, int minArgs) Create this type of generator from a given configFunctionalGenerator(org.bukkit.configuration.ConfigurationSection section, WbsSettings settings, String directory, int minArgs, int maxArgs) Create this type of generator from a given configClone constructor.FunctionalGenerator(NumProvider... args) -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidAn internal method called beforeDoubleGenerator.getNewValue(), to allow implementing classes to refresh the provider in a controlled way.voidwriteToConfig(org.bukkit.configuration.ConfigurationSection section, String path) Save this provider in a config (that can often by read by its constructor)Methods inherited from class wbs.utils.util.providers.generator.num.DoubleGenerator
clone, getNewValue, getValue, refresh
-
Field Details
-
args
-
-
Constructor Details
-
FunctionalGenerator
Clone constructor.- Parameters:
clone- The object to clone from.
-
FunctionalGenerator
- Parameters:
args- The values (or value providers) to operate on.
-
FunctionalGenerator
- Parameters:
args- The values (or value providers) to operate on.
-
FunctionalGenerator
public FunctionalGenerator(double... args) - Parameters:
args- The values (or value providers) to operate on.
-
FunctionalGenerator
public FunctionalGenerator(org.bukkit.configuration.ConfigurationSection section, WbsSettings settings, String directory) Create this generator from a ConfigurationSection, logging errors in the given settings- Parameters:
section- The section where this generator is definedsettings- The settings to log errors againstdirectory- The path taken through the config to get to this point, for logging purposes
-
FunctionalGenerator
public FunctionalGenerator(org.bukkit.configuration.ConfigurationSection section, WbsSettings settings, String directory, int minArgs) Create this type of generator from a given config- Parameters:
section- The section to read fromsettings- The settings to log errors againstdirectory- The path taken through the section to reach this provider, for logging purposesminArgs- The minimum number of arguments needed for this generator to work
-
FunctionalGenerator
public FunctionalGenerator(org.bukkit.configuration.ConfigurationSection section, WbsSettings settings, String directory, int minArgs, int maxArgs) Create this type of generator from a given config- Parameters:
section- The section to read fromsettings- The settings to log errors againstdirectory- The path taken through the section to reach this provider, for logging purposesminArgs- The minimum number of arguments needed for this generator to workmaxArgs- The maximum number of arguments this generator is defined on
-
-
Method Details
-
refreshInternal
protected final void refreshInternal()Description copied from class:DoubleGeneratorAn internal method called beforeDoubleGenerator.getNewValue(), to allow implementing classes to refresh the provider in a controlled way.- Overrides:
refreshInternalin classDoubleGenerator
-
writeToConfig
Description copied from interface:ProviderSave this provider in a config (that can often by read by its constructor)- Specified by:
writeToConfigin interfaceProvider- Specified by:
writeToConfigin classDoubleGenerator- Parameters:
section- The section to write topath- The field/path inside the given section
-