Package dev.roanh.gmark.core
Enum Class DistributionType
- All Implemented Interfaces:
Serializable
,Comparable<DistributionType>
,Constable
Enum of all probability distributions supported by gMark.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionRepresents a gaussian (normal) distribution where numbers are normally distributed with some given mean and standard deviation.Indicates that the distribution is not known.Represents a uniform distribution where number are uniformly distributed between some given minimum and maximum number.Represents a zipfian distribution with some given alpha value. -
Field Summary
Modifier and TypeFieldDescriptionprivate Function<Element,
Distribution> Function to construct a distribution from a configuration element.private String
The ID of this distribution (as used in config files). -
Constructor Summary
ModifierConstructorDescriptionprivate
DistributionType
(String id, Function<Element, Distribution> ctor) Constructs a new distribution type with the given ID and constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic final DistributionType
Resolves a distribution type by its configuration file ID.getID()
Gets the id of this distribution (as used in configuration files).newInstance
(Element data) Constructs a new instance of this distribution from the given configuration file element.toString()
static DistributionType
Returns the enum constant of this class with the specified name.static DistributionType[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNDEFINED
Indicates that the distribution is not known. -
UNIFORM
Represents a uniform distribution where number are uniformly distributed between some given minimum and maximum number. -
GAUSSIAN
Represents a gaussian (normal) distribution where numbers are normally distributed with some given mean and standard deviation. -
ZIPFIAN
Represents a zipfian distribution with some given alpha value.
-
-
Field Details
-
id
The ID of this distribution (as used in config files). -
constructor
Function to construct a distribution from a configuration element.
-
-
Constructor Details
-
DistributionType
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
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
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 nameNullPointerException
- if the argument is null
-
getID
Gets the id of this distribution (as used in configuration files).- Returns:
- The name of this distribution.
-
newInstance
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
- Overrides:
toString
in classEnum<DistributionType>
-
getByName
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.
-