Class ImmutableTransformedDistribution

java.lang.Object
io.github.ai4ci.util.ImmutableTransformedDistribution
All Implemented Interfaces:
Abstraction.Distribution, TransformedDistribution

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTransformedDistribution extends Object implements TransformedDistribution
Immutable implementation of TransformedDistribution.

Use the builder to create immutable instances: ImmutableTransformedDistribution.builder().

  • Method Details

    • getBaseDistribution

      public Abstraction.Distribution getBaseDistribution()
      Specified by:
      getBaseDistribution in interface TransformedDistribution
      Returns:
      The value of the baseDistribution attribute
    • getLink

      public DoubleUnaryOperator getLink()
      Specified by:
      getLink in interface TransformedDistribution
      Returns:
      The value of the link attribute
    • getInverseLink

      public DoubleUnaryOperator getInverseLink()
      Specified by:
      getInverseLink in interface TransformedDistribution
      Returns:
      The value of the inverseLink attribute
    • withBaseDistribution

      public final ImmutableTransformedDistribution withBaseDistribution(Abstraction.Distribution value)
      Copy the current immutable object by setting a value for the baseDistribution attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for baseDistribution
      Returns:
      A modified copy of the this object
    • withLink

      Copy the current immutable object by setting a value for the link attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for link
      Returns:
      A modified copy of the this object
    • withInverseLink

      public final ImmutableTransformedDistribution withInverseLink(DoubleUnaryOperator value)
      Copy the current immutable object by setting a value for the inverseLink attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for inverseLink
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTransformedDistribution that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: baseDistribution, link, inverseLink.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value TransformedDistribution with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      Creates an immutable copy of a TransformedDistribution value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable TransformedDistribution instance
    • toBuilder

      Creates a builder for ImmutableTransformedDistribution.prefilled with attibute values of this instance to easily create modified copies.
      Returns:
      A new ImmutableTransformedDistribution builder with attributes of this instance
    • builder

      Creates a builder for ImmutableTransformedDistribution.
       ImmutableTransformedDistribution.builder()
          .setBaseDistribution(io.github.ai4ci.abm.mechanics.Abstraction.Distribution) // required baseDistribution
          .setLink(function.DoubleUnaryOperator) // required link
          .setInverseLink(function.DoubleUnaryOperator) // required inverseLink
          .build();
       
      Returns:
      A new ImmutableTransformedDistribution builder