| 1 |
/* |
| 2 |
* Created on Apr 2, 2004 |
| 3 |
* |
| 4 |
* Copyright (c) 2004, the JUNG Project and the Regents of the University |
| 5 |
* of California |
| 6 |
* All rights reserved. |
| 7 |
* |
| 8 |
* This software is open-source under the BSD license; see either |
| 9 |
* "license.txt" or |
| 10 |
* http://jung.sourceforge.net/license.txt for a description. |
| 11 |
*/ |
| 12 |
package edu.uci.ics.jung.algorithms.shortestpath; |
| 13 |
|
| 14 |
import java.util.Map; |
| 15 |
|
| 16 |
|
| 17 |
/** |
| 18 |
* An interface for classes which calculate the distance between |
| 19 |
* one vertex and another. |
| 20 |
* |
| 21 |
* @author Joshua O'Madadhain |
| 22 |
*/ |
| 23 |
public interface Distance<V> |
| 24 |
{ |
| 25 |
/** |
| 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. |
| 29 |
*/ |
| 30 |
Number getDistance(V source, V target); |
| 31 |
|
| 32 |
/** |
| 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. |
| 39 |
*/ |
| 40 |
Map<V,Number> getDistanceMap(V source); |
| 41 |
} |