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>
ASeededVariableAmount
which wraps anotherVariableAmount
and defers all operations to the inner VariableAmount without the seed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.api.util.weighted.SeededVariableAmount
SeededVariableAmount.WrappedVariableAmount<T>
-
-
Constructor Summary
Constructors Constructor Description WrappedVariableAmount(VariableAmount inner)
Creates a new WrappedVariableAmount wrapping the givenVariableAmount
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
amount(Random rand, T seed)
Gets an instance of the variable amount depending on the given random object and the seed object.boolean
equals(Object obj)
int
hashCode()
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.spongepowered.api.util.weighted.SeededVariableAmount
flooredAmount
-
-
-
-
Constructor Detail
-
WrappedVariableAmount
public WrappedVariableAmount(VariableAmount inner)
Creates a new WrappedVariableAmount wrapping the givenVariableAmount
.- Parameters:
inner
- The inner variable amount
-
-
Method Detail
-
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 interfaceSeededVariableAmount<T>
- Parameters:
rand
- The random objectseed
- The seed object- Returns:
- The amount
-
-