Class WeightedEntry<E>

java.lang.Object
me.sciguymjm.uberenchant.api.utils.random.WeightedEntry<E>
Type Parameters:
E - The type of entry
All Implemented Interfaces:
Weighted<E>

public class WeightedEntry<E> extends Object implements Weighted<E>
A basic class implementing the Weighted interface for ease of use.
  • Field Details

    • weight

      protected double weight
    • value

      protected E value
  • Constructor Details

    • WeightedEntry

      public WeightedEntry(E value, double weight)
      Constructor for a WeightedEntry
      Parameters:
      value - The value for when selected
      weight - The Weight the result has
  • Method Details

    • value

      public E value()
      Description copied from interface: Weighted
      Gets the value
      Specified by:
      value in interface Weighted<E>
      Returns:
      The value
    • weight

      public double weight()
      Description copied from interface: Weighted
      Gets the weight
      Specified by:
      weight in interface Weighted<E>
      Returns:
      The weight