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 Summary
Constructors Constructor Description WeightedObject(T obj, double weight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
T
get()
Gets the entry contained in this entry.int
hashCode()
java.lang.String
toString()
-
Methods inherited from class org.spongepowered.api.util.weighted.TableEntry
weight
-
-
-
-
Constructor Detail
-
WeightedObject
public WeightedObject(T obj, double weight)
- Parameters:
obj
- The objectweight
- The weight of the object
-
-
Method Detail
-
get
public T get()
Gets the entry contained in this entry.- Returns:
- The object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-