All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jdsl.core.ref.SILGraph

java.lang.Object
   |
   +----jdsl.core.ref.SILGraph

public class SILGraph
extends Object
implements Graph
This is the teach simplification/modification of the advanced Simple Incidence List Graph.


Constructor Index

 o SILGraph()
Constructs a new, empty Graph.

Method Index

 o adjacentVertices(Vertex)
Gets the adjacent vertices to a particular vertex.
 o degree(Vertex)
Gets the number of incident edges of a vertex.
 o destination(Edge)
Gets the destination of an edge.
 o directedEdges()
Gets all the directedEdges in this graph.
 o edges()
Gets all the edges in this graph.
 o elements()
Gets the elements in this graph.
 o endVertices(Edge)
Gets the endpoints of an edge.
 o inAdjacentVertices(Vertex)
Gets all the vertices that are the source of an incoming incident edge to a vertex.
 o incidentEdges(Vertex)
Returns all edges incident to a particular vertex.
 o inDegree(Vertex)
Gets the number of incoming incident edges of a vertex.
 o inIncidentEdges(Vertex)
Returns all edges incident to a particular vertex.
 o insertDirectedEdge(Vertex, Vertex, Object)
Inserts a directed edge into this graph.
 o insertEdge(Vertex, Vertex, Object)
Inserts an edge into this graph.
 o insertVertex(Object)
Inserts a vertex into this graph.
 o isDirected(Edge)
Tests if an edge is directed.
 o isEmpty()
Tests if this container is empty.
 o makeUndirected(Edge)
Makes a directed edge undirected.
 o newContainer()
Constructs a new, empty Graph.
 o numEdges()
Gets the number of edges in this graph.
 o numVertices()
Gets the number of vertices in this graph.
 o opposite(Vertex, Edge)
Gets the end vertex of Edge e that is different from Vertex v.
 o origin(Edge)
Gets the origin of an edge.
 o outAdjacentVertices(Vertex)
Gets all the vertices that are the destination of an outgoing incident edge to a vertex.
 o outDegree(Vertex)
Gets the number of outgoing incident edges of a vertex.
 o outIncidentEdges(Vertex)
Gets all edges incident from a particular vertex.
 o positions()
Gets all the positions in this graph.
 o removeEdge(Edge)
Removes an edge from this graph.
 o removeVertex(Vertex)
Removes a vertex from this graph.
 o replace(Position, Object)
Replaces the object associated with a position.
 o reverseDirection(Edge)
Reverses 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 to a vertex.
 o size()
Gets the size of this graph.
 o swap(Position, Position)
Swaps the elements of two positions.
 o undirectedEdges()
Gets all the undirected edges in this graph.
 o vertices()
Gets all the vertices in this graph.

Constructors

 o SILGraph
 public SILGraph()
Constructs a new, empty Graph.

Methods

 o newContainer
 public Container newContainer()
Constructs a new, empty Graph.

 o size
 public int size()
Gets the size of this graph.

Returns:
the size, which is the number of edges plus the number of vertices.
 o isEmpty
 public boolean isEmpty()
Tests if this container is empty.

Returns:
true if this container contains no vertices or edges, false otherwise.
 o elements
 public Enumeration elements()
Gets the elements in this graph.

Returns:
The objects associated with the vertices in this graph.
See Also:
insertVertex, insertEdge
 o positions
 public Enumeration positions()
Gets all the positions in this graph.

Returns:
All of the edges and vertices in this graph.
 o replace
 public Object replace(Position p,
                       Object newElement) throws InvalidPositionException
Replaces the object associated with a position.

Parameters:
p - Any position in the graph.
newElement - The new element to associate with the Position
Returns:
The old object associated with p
Throws: InvalidPositionException
if p is not compatible with this container.
 o swap
 public void swap(Position a,
                  Position b) throws InvalidPositionException
Swaps the elements of two positions. The Positions stay in place.

Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o numVertices
 public int numVertices()
Gets the number of vertices in this graph.

 o numEdges
 public int numEdges()
Gets the number of edges in this graph.

 o vertices
 public Enumeration vertices()
Gets all the vertices in this graph.

 o edges
 public Enumeration edges()
Gets all the edges in this graph.

 o directedEdges
 public Enumeration directedEdges()
Gets all the directedEdges in this graph.

 o undirectedEdges
 public Enumeration undirectedEdges()
Gets all the undirected edges in this graph.

 o degree
 public int degree(Vertex v)
Gets the number of incident edges of a vertex.

 o inDegree
 public int inDegree(Vertex v)
Gets the number of incoming incident edges of a vertex.

 o outDegree
 public int outDegree(Vertex v)
Gets the number of outgoing incident edges of a vertex.

 o adjacentVertices
 public Enumeration adjacentVertices(Vertex v) throws InvalidPositionException
Gets the adjacent vertices to a particular vertex.

Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o inAdjacentVertices
 public Enumeration inAdjacentVertices(Vertex v) throws InvalidPositionException
Gets all the vertices that are the source of an incoming incident edge to a vertex.

Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o outAdjacentVertices
 public Enumeration outAdjacentVertices(Vertex v) throws InvalidPositionException
Gets all the vertices that are the destination of an outgoing incident edge to a vertex.

Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o incidentEdges
 public Enumeration incidentEdges(Vertex v) throws InvalidPositionException
Returns all edges incident to a particular vertex.

Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o inIncidentEdges
 public Enumeration inIncidentEdges(Vertex v) throws InvalidPositionException
Returns all edges incident to a particular vertex.

Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o outIncidentEdges
 public Enumeration outIncidentEdges(Vertex v) throws InvalidPositionException
Gets all edges incident from a particular vertex.

Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o endVertices
 public Vertex[] endVertices(Edge e) throws InvalidPositionException
Gets the endpoints of an edge.

Throws: InvalidPositionException
if the edge is invalid or incompatible with this Graph
 o opposite
 public Vertex opposite(Vertex v,
                        Edge e) throws InvalidEdgeException, InvalidPositionException
Gets the end vertex of Edge e that is different from Vertex v. If Edge e is a self loop (both oritin and destination are the same vertex), then v will be returned.

Parameters:
e - Any edge in the graph.
v - A vertex of e
Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o origin
 public Vertex origin(Edge e) throws InvalidEdgeException, InvalidPositionException
Gets the origin of an edge.

Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o destination
 public Vertex destination(Edge e) throws InvalidEdgeException, InvalidPositionException
Gets the destination of an edge.

Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o isDirected
 public boolean isDirected(Edge e) throws InvalidEdgeException
Tests if an edge is directed.

Returns:
true if the edge is directed, false otherwise.
 o insertVertex
 public Vertex insertVertex(Object info) throws InvalidPositionException
Inserts a vertex into this graph.

Parameters:
info - Any Object to be associated with this vertex.
Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o insertEdge
 public Edge insertEdge(Vertex v1,
                        Vertex v2,
                        Object elt) throws InvalidPositionException
Inserts an edge into this graph.

Parameters:
v1 - An endpoint of the edge.
v2 - An endpoint of the edge.
elt - Any Object to be associated with this edge.
Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o insertDirectedEdge
 public Edge insertDirectedEdge(Vertex v1,
                                Vertex v2,
                                Object elt) throws InvalidPositionException
Inserts a directed edge into this graph.

Parameters:
v1 - The source of edge
v2 - The destination of the ege
elt - Any Object to be associated with this edge.
Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o removeVertex
 public Object removeVertex(Vertex v) throws InvalidPositionException
Removes a vertex from this graph. Removes all edges incident on and incident from v.

Parameters:
v - The vertex to remove.
Returns:
The Object associated with v.
Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o removeEdge
 public Object removeEdge(Edge e) throws InvalidPositionException
Removes an edge from this graph.

Parameters:
e - The edge to remove.
Returns:
the Object associated with the edge.
Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o setDirectionFrom
 public void setDirectionFrom(Edge e,
                              Vertex newOrigin) throws InvalidEdgeException, InvalidPositionException
Sets the direction of an edge away from a vertex.

Parameters:
e - The edge to change.
newOrigin - a vertex of e, now the new origion of e
Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o setDirectionTo
 public void setDirectionTo(Edge e,
                            Vertex newDestination) throws InvalidEdgeException, InvalidPositionException
Sets the direction of an edge to a vertex.

Parameters:
e - The edge to change.
newDestination - a vertex of e, now the new destination of e
Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
 o makeUndirected
 public void makeUndirected(Edge e) throws InvalidEdgeException
Makes a directed edge undirected.

 o reverseDirection
 public void reverseDirection(Edge e) throws InvalidEdgeException, InvalidPositionException
Reverses the direction of an edge.

Throws: InvalidPositionException
if the vertex is invalid or incompatible with this Graph
Throws: InvalidEdgeException
if e is not directed

All Packages  Class Hierarchy  This Package  Previous  Next  Index