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 java.lang.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(java.util.Random rand, T seed)
Gets an instance of the variable amount depending on the given random object and the seed object.boolean
equals(java.lang.Object obj)
int
hashCode()
java.lang.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(java.util.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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-