001/* A common interface for all the single source longest path analyzers.
002
003 Copyright (c) 2003-2005 The University of Maryland.
004 All rights reserved.
005 Permission is hereby granted, without written agreement and without
006 license or royalty fees, to use, copy, modify, and distribute this
007 software and its documentation for any purpose, provided that the above
008 copyright notice and the following two paragraphs appear in all copies
009 of this software.
010
011 IN NO EVENT SHALL THE UNIVERSITY OF MARYLAND BE LIABLE TO ANY PARTY
012 FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
013 ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
014 THE UNIVERSITY OF MARYLAND HAS BEEN ADVISED OF THE POSSIBILITY OF
015 SUCH DAMAGE.
016
017 THE UNIVERSITY OF MARYLAND SPECIFICALLY DISCLAIMS ANY WARRANTIES,
018 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
019 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
020 PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
021 MARYLAND HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
022 ENHANCEMENTS, OR MODIFICATIONS.
023
024 */
025package ptolemy.graph.analysis.analyzer;
026
027import java.util.List;
028
029import ptolemy.graph.Node;
030
031//////////////////////////////////////////////////////////////////////////
032//// SingleSourceLongestPathAnalyzer
033
034/**
035 A common interface for all the single source longest path analyzers.
036 <p>
037 @see ptolemy.graph.analysis.SingleSourceLongestPathAnalysis
038 @since Ptolemy II 4.0
039 @Pt.ProposedRating Red (shahrooz)
040 @Pt.AcceptedRating Red (ssb)
041 @author Shahrooz Shahparnia
042 @version $Id$
043 */
044public interface SingleSourceLongestPathAnalyzer extends GraphAnalyzer {
045    /** Return the distance from the start node to all the other nodes in the
046     *  graph. The result is a double[] indexed by the destination node label.
047     *
048     *  @see ptolemy.graph.Graph#nodeLabel
049     *  @return Return the distance from the start node to all the other nodes
050     *  in the graph.
051     */
052    public double[] distance();
053
054    /** Return the start node of this analyzer.
055     *
056     *  @return Return the start node of this analyzer.
057     *  @see #setStartNode(Node)
058     */
059    public Node getStartNode();
060
061    /** Return the longest path from node "startNode" to node "endNode" in the
062     *  form of an ordered list.
063     *
064     *  @param endNode The ending node of the path.
065     *  @return The longest path from startNode to endNode.
066     */
067    public List path(Node endNode);
068
069    /** Return the length of the longest path from node "startNode"
070     *  to node "endNode". The source node can be
071     *  set using {@link #setStartNode}.
072     *
073     *  @param endNode The ending node of the path.
074     *  @return The length of the longest path.
075     */
076    public double pathLength(Node endNode);
077
078    /** Set the single source node of this analyzer to the given node.
079     *
080     *  @param startNode The given node.
081     *  @see #getStartNode()
082     */
083    public void setStartNode(Node startNode);
084}