|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEDU.auburn.VGJ.graph.Graph
A class for representing a graph abstractly.
Here is the source.
Field Summary | |
protected java.util.Hashtable |
edges_
edges_ stores all edges in the graph. |
protected java.util.Hashtable |
idHash_
idHash_ is a lookup table for node ids. |
protected int |
lastTopId_
lastTopId_ holds the next available id for a node. |
protected NodeList |
nodeList_
nodeList_ holds the graph. |
Constructor Summary | |
Graph()
construct empty graph |
|
Graph(boolean yesorno)
construct empty graph with direction |
|
Graph(GMLobject gml)
|
Method Summary | |
Set |
children(int n)
|
java.lang.Object |
clone()
makes a copy of the current graph |
void |
copy(Graph newgraph)
Copy the properties of another graph. |
void |
dummysToEdgePaths()
Convert dummy nodes to edge paths. |
int |
firstAvailable()
|
Node |
firstNode()
|
int |
firstNodeIndex()
|
Edge |
getEdge(int n1,
int n2)
|
DPoint3[] |
getEdgePathPoints(int n1,
int n2)
Get the path points for an edge. |
java.util.Enumeration |
getEdges()
|
int |
getIndexFromNode(Node node)
|
Node |
getNodeFromId(int id)
|
Node |
getNodeFromIndex(int index)
|
void |
group(Node node,
boolean state)
|
int |
highestIndex()
|
void |
insertEdge(Edge edge)
Insert an edge. |
void |
insertEdge(int n1,
int n2)
insert an edge between two nodes |
void |
insertEdge(int n1,
int n2,
DPoint3[] points)
Insert an edge with path points. |
void |
insertEdge(int n1,
int n2,
DPoint3[] points,
java.lang.String label)
Insert an edge with path points and a label. |
int |
insertNode()
insert new node into graph; no initial connections |
int |
insertNode(boolean dummy)
Insert new node or dummy node into the graph. |
void |
insertNodeAt(int index)
insert new node into graph; into the nodelist at the index |
boolean |
isDirected()
function to determine the graph type (directed or undirected) |
void |
killGroup(Node node)
|
Node |
nextNode(Node node)
|
int |
nextNodeIndex(int index)
|
Node |
nodeFromIndex(int index)
|
int |
numberOfNodes()
|
void |
pack()
Re-index so the indexes go from 0 to number of nodes - 1. |
Set |
parents(int n)
|
void |
removeEdge(Edge edge)
|
void |
removeEdge(int n1,
int n2)
remove the connection from n1 to n2 but leave the nodes in place |
void |
removeEdgePaths()
Eliminate edge paths. |
void |
removeGroups()
|
void |
removeNode(int n)
remove the node from the graph(also removes the edges connected to it) |
void |
removeNode(Node nin)
remove the node from the graph |
void |
setDirected(boolean directed)
|
void |
setGMLvalues(GMLobject gml)
Set the GML values of a GML object to those of this Graph. |
void |
setNodeGroup(Node node,
Node groupnode)
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected NodeList nodeList_
protected java.util.Hashtable idHash_
protected int lastTopId_
protected java.util.Hashtable edges_
Constructor Detail |
public Graph()
public Graph(boolean yesorno)
public Graph(GMLobject gml)
Method Detail |
public void setGMLvalues(GMLobject gml)
public boolean isDirected()
public java.lang.Object clone()
public void copy(Graph newgraph)
public int insertNode()
public int insertNode(boolean dummy)
public Node getNodeFromIndex(int index)
public Node getNodeFromId(int id)
public void insertNodeAt(int index) throws java.io.IOException
java.io.IOException
public void removeNode(int n)
public void removeNode(Node nin)
public void insertEdge(int n1, int n2)
public void insertEdge(int n1, int n2, DPoint3[] points)
public void insertEdge(int n1, int n2, DPoint3[] points, java.lang.String label)
public void insertEdge(Edge edge)
public DPoint3[] getEdgePathPoints(int n1, int n2)
public Edge getEdge(int n1, int n2)
public void removeEdge(int n1, int n2)
public void removeEdge(Edge edge)
public Set parents(int n)
public Set children(int n)
public int numberOfNodes()
public Node firstNode()
public Node nextNode(Node node)
public int getIndexFromNode(Node node)
public int firstNodeIndex()
public int nextNodeIndex(int index)
public int firstAvailable()
public int highestIndex()
public void setDirected(boolean directed)
public void pack()
public void removeEdgePaths()
public void dummysToEdgePaths()
public java.util.Enumeration getEdges()
public Node nodeFromIndex(int index)
public void group(Node node, boolean state)
public void killGroup(Node node)
public void setNodeGroup(Node node, Node groupnode)
public void removeGroups()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |