All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface jdsl.core.api.Graph

public interface Graph
extends InspectableGraph
An interface describing a graph as a combinatorial object. Holds both directed and undirected edges. Note that the Vertex and Edge interfaces are subinterfaces of jdsl.core.api.Position -- empty subinterfaces, for type safety only.


Method Index

 o insertDirectedEdge(Vertex, Vertex, Object)
Inserts a new directed edge from an existing vertex to another.
 o insertEdge(Vertex, Vertex, Object)
Inserts a new undirected edge between two existing vertices.
 o insertVertex(Object)
Inserts a new isolated vertex containing an object.
 o makeUndirected(Edge)
Makes a directed edge undirected.
 o removeEdge(Edge)
Removes an edge.
 o removeVertex(Vertex)
Deletes a vertex and all its incident edges.
 o reverseDirection(Edge)
Reverse the direction of an edge.
 o setDirectionFrom(Edge, Vertex)
Sets the direction of an edge away from a vertex.
 o setDirectionTo(Edge, Vertex)
Sets the direction of an edge towards a vertex.

Methods

 o insertVertex
 public abstract Vertex insertVertex(Object info) throws InvalidPositionException
Inserts a new isolated vertex containing an object.

Parameters:
info - the object to be stored in the new vertex
Returns:
the new vertex
 o insertEdge
 public abstract Edge insertEdge(Vertex u,
                                 Vertex v,
                                 Object info) throws InvalidPositionException
Inserts a new undirected edge between two existing vertices.

Parameters:
u - the first endvertex
v - the second endvertex
Returns:
the new edge
 o insertDirectedEdge
 public abstract Edge insertDirectedEdge(Vertex u,
                                         Vertex v,
                                         Object info) throws InvalidPositionException
Inserts a new directed edge from an existing vertex to another.

Parameters:
u - the origin vertex
v - the destination vertex
Returns:
the new edge
 o removeVertex
 public abstract Object removeVertex(Vertex v) throws InvalidPositionException
Deletes a vertex and all its incident edges. If you need the locators stored at the removed edges, get the locators beforehand.

Parameters:
v - the vertex to be deleted
Returns:
Locator formerly stored at v
 o removeEdge
 public abstract Object removeEdge(Edge e) throws InvalidPositionException
Removes an edge.

Parameters:
e - the edge to be removed
Returns:
The removed edge's element
 o setDirectionFrom
 public abstract void setDirectionFrom(Edge e,
                                       Vertex newOrigin) throws InvalidEdgeException, InvalidPositionException
Sets the direction of an edge away from a vertex. Makes an undirected edge directed.

Parameters:
e - an edge
v - an endvertex of e
 o setDirectionTo
 public abstract void setDirectionTo(Edge e,
                                     Vertex newDestination) throws InvalidEdgeException, InvalidPositionException
Sets the direction of an edge towards a vertex. Makes an undirected edge directed.

Parameters:
e - an edge
v - an endvertex of e
 o makeUndirected
 public abstract void makeUndirected(Edge e) throws InvalidEdgeException
Makes a directed edge undirected. Does nothing if the edge is undirected.

Parameters:
e - an edge
 o reverseDirection
 public abstract void reverseDirection(Edge e) throws InvalidEdgeException, InvalidPositionException
Reverse the direction of an edge.

Parameters:
e - an edge

All Packages  Class Hierarchy  This Package  Previous  Next  Index