Class RandomWeightedSet<A>

java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<A,Double>
com.pixelmonmod.pixelmon.api.util.RandomWeightedSet<A>
Type Parameters:
A - The type
All Implemented Interfaces:
Serializable, Cloneable, Map<A,Double>

public class RandomWeightedSet<A> extends HashMap<A,Double>
A set of items that have weighted and can be randomly selected from according to said weightings
See Also:
  • Field Details

    • treeMap

      protected final transient NavigableMap<Double,A> treeMap
    • totalWeight

      protected transient double totalWeight
  • Constructor Details

    • RandomWeightedSet

      public RandomWeightedSet()
    • RandomWeightedSet

      public RandomWeightedSet(A a, double weight)
  • Method Details