|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectAbstractGraph
public abstract class AbstractGraph
This class represents an abstract graph structure. It is largely stolen from our CSC 210 textbook by Koffman & Wolfgang.
| Field Summary | |
|---|---|
protected int |
numVerts
Number of vertices in the graph |
| Constructor Summary | |
|---|---|
AbstractGraph(int numVerts)
Create a graph with the specified number of vertices. |
|
| Method Summary | |
|---|---|
abstract void |
addEdge(Edge e)
|
abstract AbstractGraph |
createGraph(int numVerts)
Factory method creates a new graph. |
abstract java.util.Iterator<Edge> |
edgeIterator(int v1)
|
abstract Edge |
getEdge(int v1,
int v2)
|
int |
getNumVerts()
Returns the number of vertices in the graph. |
abstract boolean |
hasEdge(int v1,
int v2)
|
abstract void |
removeAllEdges()
|
abstract void |
removeEdge(Edge e)
|
abstract void |
setAllEdgeWeights(double w)
|
java.lang.String |
toString()
Returns a debugging string for the graph. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int numVerts
| Constructor Detail |
|---|
public AbstractGraph(int numVerts)
numVerts - Number of vertices in the new graph.| Method Detail |
|---|
public int getNumVerts()
public abstract AbstractGraph createGraph(int numVerts)
numVerts - Number of vertices in the new graph.
public abstract void addEdge(Edge e)
public abstract void removeEdge(Edge e)
public abstract void removeAllEdges()
public abstract boolean hasEdge(int v1,
int v2)
public abstract Edge getEdge(int v1,
int v2)
public abstract void setAllEdgeWeights(double w)
public abstract java.util.Iterator<Edge> edgeIterator(int v1)
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||