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.
- Version:
- $Revision: 1.3 $, $Date: 1998/07/07 19:27:40 $
- Author:
- Mike Boilen
-
insertDirectedEdge(Vertex, Vertex, Object)
- Inserts a new directed edge from an existing vertex to another.
-
insertEdge(Vertex, Vertex, Object)
- Inserts a new undirected edge between two existing vertices.
-
insertVertex(Object)
- Inserts a new isolated vertex containing an object.
-
makeUndirected(Edge)
- Makes a directed edge undirected.
-
removeEdge(Edge)
- Removes an edge.
-
removeVertex(Vertex)
- Deletes a vertex and all its incident edges.
-
reverseDirection(Edge)
- Reverse the direction of an edge.
-
setDirectionFrom(Edge, Vertex)
- Sets the direction of an edge away from a vertex.
-
setDirectionTo(Edge, Vertex)
- Sets the direction of an edge towards a vertex.
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
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
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
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
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
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
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
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
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