/** A specialization of class Dijkstra that extracts edge weights from * decorations. */ public class MyDijkstra extends Dijkstra { /** Attribute for edge weights. */ protected Object WEIGHT; /** Constructor that sets the weight attribute. */ public MyDijkstra(Object weight_attribute) { WEIGHT = weight_attribute; } /** The edge weight is stored in attribute WEIGHT of the edge. */ public int weight(Edge e) { return ((Integer) e.get(WEIGHT)).intValue(); } }