Class SeededVariableAmount.WrappedVariableAmount<T>

java.lang.Object
org.spongepowered.api.util.weighted.SeededVariableAmount.WrappedVariableAmount<T>
Type Parameters:
T - The seed type
All Implemented Interfaces:
SeededVariableAmount<T>
Enclosing interface:
SeededVariableAmount<T>

public static final class SeededVariableAmount.WrappedVariableAmount<T> extends Object implements SeededVariableAmount<T>
A SeededVariableAmount which wraps another VariableAmount and defers all operations to the inner VariableAmount without the seed.
  • Constructor Details

    • WrappedVariableAmount

      public WrappedVariableAmount(VariableAmount inner)
      Creates a new WrappedVariableAmount wrapping the given VariableAmount.
      Parameters:
      inner - The inner variable amount
  • Method Details

    • amount

      public double amount(Random rand, T seed)
      Description copied from interface: SeededVariableAmount
      Gets an instance of the variable amount depending on the given random object and the seed object.
      Specified by:
      amount in interface SeededVariableAmount<T>
      Parameters:
      rand - The random object
      seed - The seed object
      Returns:
      The amount
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object