|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jdsl.core.ref.SILGraph
This is the teach simplification/modification of the advanced Simple Incidence List Graph.
| Constructor Summary | |
SILGraph()
Constructs a new, empty Graph. |
|
| Method Summary | |
java.util.Enumeration |
adjacentVertices(Vertex v)
Gets the adjacent vertices to a particular vertex. |
int |
degree(Vertex v)
Gets the number of incident edges of a vertex. |
Vertex |
destination(Edge e)
Gets the destination of an edge. |
java.util.Enumeration |
directedEdges()
Gets all the directedEdges in this graph. |
java.util.Enumeration |
edges()
Gets all the edges in this graph. |
java.util.Enumeration |
elements()
Gets the elements in this graph. |
Vertex[] |
endVertices(Edge e)
Gets the endpoints of an edge. |
java.util.Enumeration |
inAdjacentVertices(Vertex v)
Gets all the vertices that are the source of an incoming incident edge to a vertex. |
java.util.Enumeration |
incidentEdges(Vertex v)
Returns all edges incident to a particular vertex. |
int |
inDegree(Vertex v)
Gets the number of incoming incident edges of a vertex. |
java.util.Enumeration |
inIncidentEdges(Vertex v)
Returns all edges incident to a particular vertex. |
Edge |
insertDirectedEdge(Vertex v1,
Vertex v2,
java.lang.Object elt)
Inserts a directed edge into this graph. |
Edge |
insertEdge(Vertex v1,
Vertex v2,
java.lang.Object elt)
Inserts an edge into this graph. |
Vertex |
insertVertex(java.lang.Object info)
Inserts a vertex into this graph. |
boolean |
isDirected(Edge e)
Tests if an edge is directed. |
boolean |
isEmpty()
Tests if this container is empty. |
void |
makeUndirected(Edge e)
Makes a directed edge undirected. |
Container |
newContainer()
Constructs a new, empty Graph. |
int |
numEdges()
Gets the number of edges in this graph. |
int |
numVertices()
Gets the number of vertices in this graph. |
Vertex |
opposite(Vertex v,
Edge e)
Gets the end vertex of Edge e that is different from
Vertex v. |
Vertex |
origin(Edge e)
Gets the origin of an edge. |
java.util.Enumeration |
outAdjacentVertices(Vertex v)
Gets all the vertices that are the destination of an outgoing incident edge to a vertex. |
int |
outDegree(Vertex v)
Gets the number of outgoing incident edges of a vertex. |
java.util.Enumeration |
outIncidentEdges(Vertex v)
Gets all edges incident from a particular vertex. |
java.util.Enumeration |
positions()
Gets all the positions in this graph. |
java.lang.Object |
removeEdge(Edge e)
Removes an edge from this graph. |
java.lang.Object |
removeVertex(Vertex v)
Removes a vertex from this graph. |
java.lang.Object |
replace(Position p,
java.lang.Object newElement)
Replaces the object associated with a position. |
void |
reverseDirection(Edge e)
Reverses the direction of an edge. |
void |
setDirectionFrom(Edge e,
Vertex newOrigin)
Sets the direction of an edge away from a vertex. |
void |
setDirectionTo(Edge e,
Vertex newDestination)
Sets the direction of an edge to a vertex. |
int |
size()
Gets the size of this graph. |
void |
swap(Position a,
Position b)
Swaps the elements of two positions. |
java.util.Enumeration |
undirectedEdges()
Gets all the undirected edges in this graph. |
java.util.Enumeration |
vertices()
Gets all the vertices in this graph. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public SILGraph()
| Method Detail |
public Container newContainer()
public int size()
public boolean isEmpty()
true if this container contains no vertices or
edges, false otherwise.public java.util.Enumeration elements()
insertVertex,
insertEdgepublic java.util.Enumeration positions()
public java.lang.Object replace(Position p,
java.lang.Object newElement)
throws InvalidPositionException
p - Any position in the graph.newElement - The new element to associate with the
Positionpp is not compatible
with this container.
public void swap(Position a,
Position b)
throws InvalidPositionException
Positions stay in
place.Graphpublic int numVertices()
public int numEdges()
public java.util.Enumeration vertices()
public java.util.Enumeration edges()
public java.util.Enumeration directedEdges()
public java.util.Enumeration undirectedEdges()
public int degree(Vertex v)
public int inDegree(Vertex v)
public int outDegree(Vertex v)
public java.util.Enumeration adjacentVertices(Vertex v)
throws InvalidPositionException
Graph
public java.util.Enumeration inAdjacentVertices(Vertex v)
throws InvalidPositionException
Graph
public java.util.Enumeration outAdjacentVertices(Vertex v)
throws InvalidPositionException
Graph
public java.util.Enumeration incidentEdges(Vertex v)
throws InvalidPositionException
Graph
public java.util.Enumeration inIncidentEdges(Vertex v)
throws InvalidPositionException
Graph
public java.util.Enumeration outIncidentEdges(Vertex v)
throws InvalidPositionException
Graph
public Vertex[] endVertices(Edge e)
throws InvalidPositionException
Graph
public Vertex opposite(Vertex v,
Edge e)
throws InvalidEdgeException,
InvalidPositionException
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
public Vertex origin(Edge e)
throws InvalidEdgeException,
InvalidPositionException
Graph
public Vertex destination(Edge e)
throws InvalidEdgeException,
InvalidPositionException
Graph
public boolean isDirected(Edge e)
throws InvalidEdgeException
true if the edge is directed, false
otherwise.
public Vertex insertVertex(java.lang.Object info)
throws InvalidPositionException
info - Any Object to be associated with this vertex.Graph
public Edge insertEdge(Vertex v1,
Vertex v2,
java.lang.Object elt)
throws InvalidPositionException
v1 - An endpoint of the edge.v2 - An endpoint of the edge.elt - Any Object to be associated with this edge.Graph
public Edge insertDirectedEdge(Vertex v1,
Vertex v2,
java.lang.Object elt)
throws InvalidPositionException
v1 - The source of edgev2 - The destination of the egeelt - Any Object to be associated with this edge.Graph
public java.lang.Object removeVertex(Vertex v)
throws InvalidPositionException
v.v - The vertex to remove.Object associated with v.Graph
public java.lang.Object removeEdge(Edge e)
throws InvalidPositionException
e - The edge to remove.Object associated with the edge.Graph
public void setDirectionFrom(Edge e,
Vertex newOrigin)
throws InvalidEdgeException,
InvalidPositionException
e - The edge to change.newOrigin - a vertex of e, now the new origion of
eGraph
public void setDirectionTo(Edge e,
Vertex newDestination)
throws InvalidEdgeException,
InvalidPositionException
e - The edge to change.newDestination - a vertex of e, now the new
destination of eGraph
public void makeUndirected(Edge e)
throws InvalidEdgeException
public void reverseDirection(Edge e)
throws InvalidEdgeException,
InvalidPositionException
Graph
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||