Class VariableAmount.BaseAndVariance
java.lang.Object
org.spongepowered.api.util.weighted.VariableAmount.BaseAndVariance
- All Implemented Interfaces:
- DataSerializable,- VariableAmount
- Enclosing interface:
- VariableAmount
Represents a base amount with a variance, the final amount will be the
 base amount plus or minus a random amount between zero (inclusive) and
 the variance (exclusive).
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.spongepowered.api.util.weighted.VariableAmountVariableAmount.BaseAndAddition, VariableAmount.BaseAndVariance, VariableAmount.Fixed, VariableAmount.OptionalAmount
- 
Method SummaryModifier and TypeMethodDescriptiondoubleGets an instance of the variable amount depending on the given random object.intGets the content version of thisDataSerializable.booleaninthashCode()Serializes this object into a comprehensibleDataContainer.toString()Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.spongepowered.api.util.weighted.VariableAmountflooredAmount
- 
Method Details- 
amountDescription copied from interface:VariableAmountGets an instance of the variable amount depending on the given random object.- Specified by:
- amountin interface- VariableAmount
- Parameters:
- rand- The random object
- Returns:
- The amount
 
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
- 
toContainerDescription copied from interface:DataSerializableSerializes this object into a comprehensibleDataContainer.- Specified by:
- toContainerin interface- DataSerializable
- Specified by:
- toContainerin interface- VariableAmount
- Returns:
- A newly created DataContainer
 
- 
contentVersionpublic int contentVersion()Description copied from interface:DataSerializableGets the content version of thisDataSerializable. The version may differ between instances of plugins and implementations such that theDataViewfromDataSerializable.toContainer()may include different information, or remove other information as they are no longer deemed necessary. The version goes hand in hand withDataContentUpdateras it is required when there exists anyDataViewof thisDataSerializablewith an "older" version.- Specified by:
- contentVersionin interface- DataSerializable
- Specified by:
- contentVersionin interface- VariableAmount
- Returns:
- The version of the content being serialized
 
 
-