public int compareTo(Object obj) 
    {
	if (obj.getClass() != getClass())
	    return -1;

	Neighbour n = (Neighbour) obj;
	// Negative result means that obj is less than.
	// Zero result means that obj is equal to.
	// Positive result means that obj is more than.
	return Double.compare(this.getDistance(),n.getDistance());
    }