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 Link icon

    • WeightedObject Link icon

      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 Link icon

    • get Link icon

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

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

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

      public String toString()
      Overrides:
      toString in class Object