jdsl.core.ref
Class FastSILGraph
java.lang.Object
|
+--jdsl.core.ref.FastSILGraph
- public class FastSILGraph
- extends java.lang.Object
- implements Graph
This is the teach simplification/modification of the adv SILG.
- Author:
- bh Original (adv) version, rsb First port to teach, bh Update to no-locators, bh Removed decorable, general cleanup for cs16 Spring 1998
|
Method Summary |
java.util.Enumeration |
adjacentVertices(Vertex v)
|
int |
degree(Vertex v)
|
Vertex |
destination(Edge e)
|
java.util.Enumeration |
directedEdges()
|
java.util.Enumeration |
edges()
|
java.util.Enumeration |
elements()
|
Vertex[] |
endVertices(Edge e)
|
java.util.Enumeration |
inAdjacentVertices(Vertex v)
|
java.util.Enumeration |
incidentEdges(Vertex v)
|
int |
inDegree(Vertex v)
|
java.util.Enumeration |
inIncidentEdges(Vertex v)
|
Edge |
insertDirectedEdge(Vertex v1,
Vertex v2,
java.lang.Object elt)
|
Edge |
insertEdge(Vertex v1,
Vertex v2,
java.lang.Object elt)
|
Vertex |
insertVertex(java.lang.Object info)
____ _
/ ___|_ __ __ _ _ __ | |__
| | _| '__/ _` | '_ \| '_ \
| |_| | | | (_| | |_) | | | |
\____|_| \__,_| .__/|_| |_|
|_| |
boolean |
isDirected(Edge e)
|
boolean |
isEmpty()
|
void |
makeUndirected(Edge e)
|
Container |
newContainer()
____ _ _
/ ___|___ _ __ | |_ __ _(_)_ __ ___ _ __
| | / _ \| '_ \| __/ _` | | '_ \ / _ \ '__|
| |__| (_) | | | | || (_| | | | | | __/ |
\____\___/|_| |_|\__\__,_|_|_| |_|\___|_| |
int |
numEdges()
|
int |
numVertices()
___ _ _ _
|_ _|_ __ ___ _ __ ___ ___| |_ __ _| |__ | | ___
| || '_ \/ __| '_ \ / _ \/ __| __/ _` | '_ \| |/ _ \
| || | | \__ \ |_) | __/ (__| || (_| | |_) | | __/
|___|_| |_|___/ .__/ \___|\___|\__\__,_|_.__/|_|\___|
|_| |
Vertex |
opposite(Vertex v,
Edge e)
|
Vertex |
origin(Edge e)
|
java.util.Enumeration |
outAdjacentVertices(Vertex v)
|
int |
outDegree(Vertex v)
|
java.util.Enumeration |
outIncidentEdges(Vertex v)
|
java.util.Enumeration |
positions()
PositionalContainer methods |
java.lang.Object |
removeEdge(Edge e)
|
java.lang.Object |
removeVertex(Vertex v)
|
java.lang.Object |
replace(Position p,
java.lang.Object newElement)
|
void |
reverseDirection(Edge e)
|
void |
setDirectionFrom(Edge e,
Vertex newOrigin)
|
void |
setDirectionTo(Edge e,
Vertex newDestination)
|
int |
size()
|
void |
swap(Position a,
Position b)
|
java.util.Enumeration |
undirectedEdges()
|
java.util.Enumeration |
vertices()
|
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
FastSILGraph
public FastSILGraph()
newContainer
public Container newContainer()
- ____ _ _
/ ___|___ _ __ | |_ __ _(_)_ __ ___ _ __
| | / _ \| '_ \| __/ _` | | '_ \ / _ \ '__|
| |__| (_) | | | | || (_| | | | | | __/ |
\____\___/|_| |_|\__\__,_|_|_| |_|\___|_|
size
public int size()
isEmpty
public boolean isEmpty()
elements
public java.util.Enumeration elements()
positions
public java.util.Enumeration positions()
- PositionalContainer methods
replace
public java.lang.Object replace(Position p,
java.lang.Object newElement)
throws InvalidPositionException
swap
public void swap(Position a,
Position b)
throws InvalidPositionException
numVertices
public int numVertices()
- ___ _ _ _
|_ _|_ __ ___ _ __ ___ ___| |_ __ _| |__ | | ___
| || '_ \/ __| '_ \ / _ \/ __| __/ _` | '_ \| |/ _ \
| || | | \__ \ |_) | __/ (__| || (_| | |_) | | __/
|___|_| |_|___/ .__/ \___|\___|\__\__,_|_.__/|_|\___|
|_|
numEdges
public int numEdges()
vertices
public java.util.Enumeration vertices()
edges
public java.util.Enumeration edges()
directedEdges
public java.util.Enumeration directedEdges()
undirectedEdges
public java.util.Enumeration undirectedEdges()
degree
public int degree(Vertex v)
inDegree
public int inDegree(Vertex v)
outDegree
public int outDegree(Vertex v)
adjacentVertices
public java.util.Enumeration adjacentVertices(Vertex v)
throws InvalidPositionException
inAdjacentVertices
public java.util.Enumeration inAdjacentVertices(Vertex v)
throws InvalidPositionException
outAdjacentVertices
public java.util.Enumeration outAdjacentVertices(Vertex v)
throws InvalidPositionException
incidentEdges
public java.util.Enumeration incidentEdges(Vertex v)
throws InvalidPositionException
inIncidentEdges
public java.util.Enumeration inIncidentEdges(Vertex v)
throws InvalidPositionException
outIncidentEdges
public java.util.Enumeration outIncidentEdges(Vertex v)
throws InvalidPositionException
endVertices
public Vertex[] endVertices(Edge e)
throws InvalidPositionException
opposite
public Vertex opposite(Vertex v,
Edge e)
throws InvalidEdgeException,
InvalidPositionException
origin
public Vertex origin(Edge e)
throws InvalidEdgeException,
InvalidPositionException
destination
public Vertex destination(Edge e)
throws InvalidEdgeException,
InvalidPositionException
isDirected
public boolean isDirected(Edge e)
throws InvalidEdgeException
insertVertex
public Vertex insertVertex(java.lang.Object info)
throws InvalidPositionException
- ____ _
/ ___|_ __ __ _ _ __ | |__
| | _| '__/ _` | '_ \| '_ \
| |_| | | | (_| | |_) | | | |
\____|_| \__,_| .__/|_| |_|
|_|
- Specified by:
- insertVertex in interface Graph
insertEdge
public Edge insertEdge(Vertex v1,
Vertex v2,
java.lang.Object elt)
throws InvalidPositionException
- Specified by:
- insertEdge in interface Graph
insertDirectedEdge
public Edge insertDirectedEdge(Vertex v1,
Vertex v2,
java.lang.Object elt)
throws InvalidPositionException
- Specified by:
- insertDirectedEdge in interface Graph
removeVertex
public java.lang.Object removeVertex(Vertex v)
throws InvalidPositionException
- Specified by:
- removeVertex in interface Graph
removeEdge
public java.lang.Object removeEdge(Edge e)
throws InvalidPositionException
- Specified by:
- removeEdge in interface Graph
setDirectionFrom
public void setDirectionFrom(Edge e,
Vertex newOrigin)
throws InvalidEdgeException,
InvalidPositionException
- Specified by:
- setDirectionFrom in interface Graph
setDirectionTo
public void setDirectionTo(Edge e,
Vertex newDestination)
throws InvalidEdgeException,
InvalidPositionException
- Specified by:
- setDirectionTo in interface Graph
makeUndirected
public void makeUndirected(Edge e)
throws InvalidEdgeException
- Specified by:
- makeUndirected in interface Graph
reverseDirection
public void reverseDirection(Edge e)
throws InvalidEdgeException,
InvalidPositionException
- Specified by:
- reverseDirection in interface Graph