Class WeightedObject<T>

java.lang.Object
org.spongepowered.api.util.weighted.TableEntry<T>
org.spongepowered.api.util.weighted.WeightedObject<T>
Type Parameters:
T - The entry type
Direct Known Subclasses:
WeightedSerializableObject

public class WeightedObject<T> extends TableEntry<T>
An entry which contains an object.
  • Constructor Details

    • WeightedObject

      public WeightedObject(T obj, double weight)
      Creates a new WeightedObject of the provided object and weight.
      Parameters:
      obj - The object
      weight - The weight of the object
  • Method Details

    • get

      public T get()
      Gets the entry contained in this entry.
      Returns:
      The object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object