Enum Class DistributionType

java.lang.Object
java.lang.Enum<DistributionType>
dev.roanh.gmark.core.DistributionType
All Implemented Interfaces:
Serializable, Comparable<DistributionType>, Constable

public enum DistributionType extends Enum<DistributionType>
Enum of all probability distributions supported by gMark.
  • Enum Constant Details

    • UNDEFINED

      public static final DistributionType UNDEFINED
      Indicates that the distribution is not known.
    • UNIFORM

      public static final DistributionType UNIFORM
      Represents a uniform distribution where number are uniformly distributed between some given minimum and maximum number.
    • GAUSSIAN

      public static final DistributionType GAUSSIAN
      Represents a gaussian (normal) distribution where numbers are normally distributed with some given mean and standard deviation.
    • ZIPFIAN

      public static final DistributionType ZIPFIAN
      Represents a zipfian distribution with some given alpha value.
  • Field Details

    • id

      private String id
      The ID of this distribution (as used in config files).
    • constructor

      private Function<Element,Distribution> constructor
      Function to construct a distribution from a configuration element.
  • Constructor Details

    • DistributionType

      private DistributionType(String id, Function<Element,Distribution> ctor)
      Constructs a new distribution type with the given ID and constructor.
      Parameters:
      id - The configuration name of this distribution.
      ctor - A function to construct this distribution from a configuration file element.
  • Method Details

    • values

      public static DistributionType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static DistributionType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getID

      public String getID()
      Gets the id of this distribution (as used in configuration files).
      Returns:
      The name of this distribution.
    • newInstance

      public Distribution newInstance(Element data)
      Constructs a new instance of this distribution from the given configuration file element.
      Parameters:
      data - The configuration file element to parse.
      Returns:
      The newly constructed distribution.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<DistributionType>
    • getByName

      public static final DistributionType getByName(String id)
      Resolves a distribution type by its configuration file ID.
      Parameters:
      id - The configuration type ID to search for.
      Returns:
      The distribution with the given configuration ID or null if no distribution type with the given ID was found.