net.walend.digraph.path
Interface GEPath

All Superinterfaces:
Digraph, GEDigraph, HasState, Path
All Known Subinterfaces:
MeasuredGEPath, MutableGEPath
All Known Implementing Classes:
AbstractDelegateDigraphOfGEPaths.DigraphGEPath, AbstractListGEPath, AbstractShortestGEPaths.DigraphMeasuredGEPath, MutableListGEPath

public interface GEPath
extends GEDigraph, Path

GEPath is an interface for represtenting paths through GEDigraph. A GEPath is expressly a subgraph of a specific GEDigraph. If two GEPaths contain the same nodes in the same order, but are subgraphs of different GEDigraphs, they have different states but are the sameGEDigraphAS().

All GEPaths except the EMPTY path must have at least one node.

By default, this digraph uses equals() as the method to determine identity. Persistent versions may use hasSameIdentity() instead, for example.

Direct implementations of GEDigraph should have a single constructor that takes another GEPath in the constructor, and produce an Immutable GEPath.

Since:
20011023
Author:
David Walend dfw1@cornell.edu

Field Summary
 
Fields inherited from interface net.walend.digraph.GEDigraph
EMPTY
 
Method Summary
 GEPath getSubpath(int startNodeIndex, int endNodeIndex)
          Returns a new path, between startNodeIndex and endNodeIndex, inclusive.
 GEPath getSubpathFirst(java.lang.Object startNode, java.lang.Object endNode)
          Returns a new path, between the first occurence of startNode and the first occurence of endNode, inclusive.
 GEPath getSubpathFirstToLast(java.lang.Object startNode, java.lang.Object endNode)
          Returns a new path, between the first occurence of startNode and the last occurence of endNode, inclusive.
 GEPath getSubpathLast(java.lang.Object startNode, java.lang.Object endNode)
          Returns a new path, between the last occurence of startNode and the last occurence of endNode, inclusive.
 GEPath getSubpathLastToFirst(java.lang.Object startNode, java.lang.Object endNode)
          Returns a new path, between the last occurence of startNode and the first occurence of endNode, inclusive.
 GEDigraph getSupergraph()
          Returns the supergraph.
 boolean sameGEPathAs(GEPath path)
          Returns true if path is the same path as this, on the same digraph.
 
Methods inherited from interface net.walend.digraph.GEDigraph
containsGEDigraph, intersectWithGEDigraph, sameGEDigraphAs, unionGEDigraph
 
Methods inherited from interface net.walend.digraph.Digraph
containsEdge, containsNode, containsNodes, countInboundEdges, countOutboundEdges, edgeCount, edgeNodeIterator, getFromNodes, getNodes, getToNodes, isEdgeFree, isEmpty, nodeCount, nodeIterator
 
Methods inherited from interface net.walend.collection.HasState
getPrincipleInterface, sameStateAs
 
Methods inherited from interface net.walend.digraph.path.Path
getHead, getIndexOfNode, getLastIndexOfNode, getNodeAtIndex, getNodeList, getTail, pathEdgeCount, pathEdgeNodeIterator, pathNodeCount, pathNodeIterator, valid
 

Method Detail

getSupergraph

public GEDigraph getSupergraph()
Returns the supergraph.


getSubpath

public GEPath getSubpath(int startNodeIndex,
                         int endNodeIndex)
                  throws InvalidSpliceException
Returns a new path, between startNodeIndex and endNodeIndex, inclusive.

InvalidSpliceException

getSubpathFirst

public GEPath getSubpathFirst(java.lang.Object startNode,
                              java.lang.Object endNode)
                       throws NodeMissingException,
                              InvalidSpliceException
Returns a new path, between the first occurence of startNode and the first occurence of endNode, inclusive.

Throws:
NodeMissingException - if the nodes are not in the path.
InvalidSpliceException - if the nodes are not in the right order.

getSubpathLast

public GEPath getSubpathLast(java.lang.Object startNode,
                             java.lang.Object endNode)
                      throws NodeMissingException,
                             InvalidSpliceException
Returns a new path, between the last occurence of startNode and the last occurence of endNode, inclusive.

Throws:
NodeMissingException - if the nodes are not in the path.
InvalidSpliceException - if the nodes are not in the right order.

getSubpathFirstToLast

public GEPath getSubpathFirstToLast(java.lang.Object startNode,
                                    java.lang.Object endNode)
                             throws NodeMissingException,
                                    InvalidSpliceException
Returns a new path, between the first occurence of startNode and the last occurence of endNode, inclusive.

Throws:
NodeMissingException - if the nodes are not in the path.
InvalidSpliceException - if the nodes are not in the right order.

getSubpathLastToFirst

public GEPath getSubpathLastToFirst(java.lang.Object startNode,
                                    java.lang.Object endNode)
                             throws NodeMissingException,
                                    InvalidSpliceException
Returns a new path, between the last occurence of startNode and the first occurence of endNode, inclusive.

Throws:
NodeMissingException - if the nodes are not in the path.
InvalidSpliceException - if the nodes are not in the right order.

sameGEPathAs

public boolean sameGEPathAs(GEPath path)
Returns true if path is the same path as this, on the same digraph. So if two paths are on different supergraphs, they may be the same digraph, but not the same path.



Copyright (c) 2001, 2002, David Walend