package graph; /** A class used to find the weight of objects, such as graph edges.

* * Remember that a comparator is passed to methods that need to regard certain * objects as comparable. Similarly, a weighter is passed to methods that * need to regard certain objects as weighted.

* * For example, an implementation might use any of the following * methods to find the weight of a graph edge e:

* *

*/ public interface Weighter { /** Find the weight of this object in an appropriate way. * @throws ClassCastException - if we don't know how. */ double weight(Object o); }