public class WeightedObject<T> extends java.lang.Object implements java.lang.Comparable<WeightedObject<T>>
Constructor and Description |
---|
WeightedObject(T obj,
double weight) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(WeightedObject<T> o)
Note that equals and compareTo are not consistent: x.compareTo(y)==0 iff x.equals(y) is
highly recommended in Java, but is not required.
|
boolean |
equals(java.lang.Object obj) |
T |
getObject() |
double |
getWeight() |
int |
hashCode() |
java.lang.String |
toString() |
public WeightedObject(T obj, double weight)
public T getObject()
public double getWeight()
public int compareTo(WeightedObject<T> o)
compareTo
in interface java.lang.Comparable<WeightedObject<T>>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object