2 * Created on Apr 2, 2004
4 * Copyright (c) 2004, the JUNG Project and the Regents of the University
8 * This software is open-source under the BSD license; see either
10 * http://jung.sourceforge.net/license.txt for a description.
12 package edu.uci.ics.jung.algorithms.shortestpath;
18 * An interface for classes which calculate the distance between
19 * one vertex and another.
21 * @author Joshua O'Madadhain
23 public interface Distance<V>
26 * Returns the distance from the <code>source</code> vertex
27 * to the <code>target</code> vertex. If <code>target</code>
28 * is not reachable from <code>source</code>, returns null.
30 Number getDistance(V source, V target);
33 * <p>Returns a <code>Map</code> which maps each vertex
34 * in the graph (including the <code>source</code> vertex)
35 * to its distance (represented as a Number)
36 * from <code>source</code>. If any vertex
37 * is not reachable from <code>source</code>, no
38 * distance is stored for that vertex.
40 Map<V,Number> getDistanceMap(V source);