/* * Created on Apr 2, 2004 * * Copyright (c) 2004, the JUNG Project and the Regents of the University * of California * All rights reserved. * * This software is open-source under the BSD license; see either * "license.txt" or * http://jung.sourceforge.net/license.txt for a description. */ package edu.uci.ics.jung.algorithms.shortestpath; import java.util.Map; /** * An interface for classes which calculate the distance between * one vertex and another. * * @author Joshua O'Madadhain */ public interface Distance { /** * Returns the distance from the source vertex * to the target vertex. If target * is not reachable from source, returns null. */ Number getDistance(V source, V target); /** *

Returns a Map which maps each vertex * in the graph (including the source vertex) * to its distance (represented as a Number) * from source. If any vertex * is not reachable from source, no * distance is stored for that vertex. */ Map getDistanceMap(V source); }