T
- The object typepublic class WeightedObject<T> extends Object
Modifier and Type | Field and Description |
---|---|
protected T |
object |
protected int |
weight |
Constructor and Description |
---|
WeightedObject(T object,
int weight)
Creates a new
WeightedObject . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
T |
get()
Gets the object.
|
int |
getWeight()
Gets the weight of this object.
|
int |
hashCode() |
String |
toString() |
protected final T object
protected final int weight
public WeightedObject(T object, int weight)
WeightedObject
.object
- The objectweight
- The weightpublic T get()
public int getWeight()