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

public abstract class FunctionalGenerator extends DoubleGenerator
A type of DoubleGenerator that takes some number of NumProviders and operates on them to determine the value
  • Field Details

  • Constructor Details

    • FunctionalGenerator

      public FunctionalGenerator(FunctionalGenerator clone)
      Clone constructor.
      Parameters:
      clone - The object to clone from.
    • FunctionalGenerator

      public FunctionalGenerator(NumProvider... args)
      Parameters:
      args - The values (or value providers) to operate on.
    • FunctionalGenerator

      public FunctionalGenerator(List<Double> args)
      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 defined
      settings - The settings to log errors against
      directory - 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 from
      settings - The settings to log errors against
      directory - The path taken through the section to reach this provider, for logging purposes
      minArgs - 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 from
      settings - The settings to log errors against
      directory - The path taken through the section to reach this provider, for logging purposes
      minArgs - The minimum number of arguments needed for this generator to work
      maxArgs - The maximum number of arguments this generator is defined on
  • Method Details

    • refreshInternal

      protected final void refreshInternal()
      Description copied from class: DoubleGenerator
      An internal method called before DoubleGenerator.getNewValue(), to allow implementing classes to refresh the provider in a controlled way.
      Overrides:
      refreshInternal in class DoubleGenerator
    • writeToConfig

      public void writeToConfig(org.bukkit.configuration.ConfigurationSection section, String path)
      Description copied from interface: Provider
      Save this provider in a config (that can often by read by its constructor)
      Specified by:
      writeToConfig in interface Provider
      Specified by:
      writeToConfig in class DoubleGenerator
      Parameters:
      section - The section to write to
      path - The field/path inside the given section