Class WeightedSet<T>

java.lang.Object
com.pixelmonmod.pixelmon.api.util.WeightedSet<T>

public class WeightedSet<T> extends Object
Weighted set impl from Atlantis. Waterdude gives himself permission to use this.
  • Constructor Details

    • WeightedSet

      protected WeightedSet()
  • Method Details

    • newWeightedSet

      public static <T> WeightedSet<T> newWeightedSet(Object... contents)
    • add

      public WeightedSet<T> add(double weight, T element)
    • clear

      public WeightedSet<T> clear()
    • get

      public T get()
    • get

      public T get(net.minecraft.util.RandomSource random)
    • get

      public T get(Random random)
    • getAndDo

      public void getAndDo(int count, Consumer<T> consumer)
    • getAndDo

      public void getAndDo(net.minecraft.util.RandomSource random, int count, Consumer<T> consumer)
    • getAndDo

      public void getAndDo(Random random, int count, Consumer<T> consumer)
    • getWeight

      public double getWeight(T element)
    • getChance

      public double getChance(T element)
    • getChanceString

      public String getChanceString(T element, int decimalPlaces)
    • isEffectivelyEmpty

      public boolean isEffectivelyEmpty()
    • isEmpty

      public boolean isEmpty()
    • size

      public int size()
    • weight

      public double weight()
    • stream

      public Stream<T> stream()
    • iterator

      public Iterator<T> iterator()
    • spliterator

      public Spliterator<T> spliterator()