support.Flight
Interface FlightGraph


public abstract interface FlightGraph
extends PositionalContainer

A subset of the Graph interface, with only methods that relate to Flight.

Author:
Saul Nadler , Benoit Hudson

Method Summary
 Vertex destination(Edge e)
          Return the vertex toward which the edge points.
 java.util.Enumeration edges()
          Return an enumeration of all the edges in the graph.
 int inDegree(Vertex v)
          Return the number of incoming edges to the vertex.
 java.util.Enumeration inIncidentEdges(Vertex v)
          Return a list of all incoming edges to the vertex.
 Edge insertDirectedEdge(Vertex u, Vertex v, java.lang.Object info)
          Insert a new edge into the graph, between the two vertices, which holds the given data.
 Vertex insertVertex(java.lang.Object info)
          Insert a new vertex into the graph, which holds the given data.
 int numEdges()
          Return the number of edges in the graph.
 int numVertices()
          Return the number of vertices in the graph.
 Vertex origin(Edge e)
          Return the vertex from which the edge points.
 int outDegree(Vertex v)
          Return the number of outgoing edges from the vertex.
 java.util.Enumeration outIncidentEdges(Vertex v)
          Return a list of all outgoing edges from the vertex.
 java.util.Enumeration vertices()
          Return an enumeration of all the vertices in the graph.
 
Methods inherited from interface jdsl.core.api.PositionalContainer
positions, replace, swap
 
Methods inherited from interface jdsl.core.api.Container
elements, newContainer
 
Methods inherited from interface jdsl.simple.api.SimpleContainer
isEmpty, size
 

Method Detail

insertVertex

public Vertex insertVertex(java.lang.Object info)
Insert a new vertex into the graph, which holds the given data.
Parameters:
info - The data to store at the new vertex.
Returns:
The new vertex.

insertDirectedEdge

public Edge insertDirectedEdge(Vertex u,
                               Vertex v,
                               java.lang.Object info)
                        throws InvalidPositionException
Insert a new edge into the graph, between the two vertices, which holds the given data.
Parameters:
u - The source vertex of the new edge.
v - The destination vertex of the new edge.
info - The data to store at the new edge.
Returns:
The new edge.

numVertices

public int numVertices()
Return the number of vertices in the graph.

numEdges

public int numEdges()
Return the number of edges in the graph.

vertices

public java.util.Enumeration vertices()
Return an enumeration of all the vertices in the graph.

edges

public java.util.Enumeration edges()
Return an enumeration of all the edges in the graph.

outDegree

public int outDegree(Vertex v)
              throws InvalidPositionException
Return the number of outgoing edges from the vertex.

inDegree

public int inDegree(Vertex v)
             throws InvalidPositionException
Return the number of incoming edges to the vertex.

outIncidentEdges

public java.util.Enumeration outIncidentEdges(Vertex v)
                                       throws InvalidPositionException
Return a list of all outgoing edges from the vertex.

inIncidentEdges

public java.util.Enumeration inIncidentEdges(Vertex v)
                                      throws InvalidPositionException
Return a list of all incoming edges to the vertex.

destination

public Vertex destination(Edge e)
                   throws InvalidPositionException
Return the vertex toward which the edge points.

origin

public Vertex origin(Edge e)
              throws InvalidPositionException
Return the vertex from which the edge points.