|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--de.rwth.graph.Graph
Class for graph data structures consisting of nodes connected with edges. Nodes
and edges can be labelled with arbitrary Objects.
This is just a class for data structures! There is no integrated creation, editing, or visualization of graphs.
However, graphs can be visualized by using an external program: dotty.
| Inner Class Summary | |
class |
Graph.Node
Represents nodes in this graph. |
class |
Graph.NodeDyer
Represents a colouring of this graph's nodes. |
| Field Summary | |
protected int |
curNumber
The number of the last node allocated in this graph. |
protected java.lang.Object |
label
The label of this graph. |
protected java.util.LinkedList |
nodes
Contains all nodes of this graph. |
protected int |
sizeEdges
|
| Constructor Summary | |
Graph()
Creates an empty graph without label. |
|
Graph(java.lang.Object label)
Creates an empty graph with label. |
|
| Method Summary | |
java.lang.Object |
getLabel()
Gets the label of this graph. |
java.util.Iterator |
getNodes()
Gets all nodes in this graph. |
static void |
main(java.lang.String[] args)
Mini test environment. |
void |
setLabel(java.lang.Object label)
Sets the label of this graph. |
int |
sizeEdges()
Gets the number of edges in this graph. |
int |
sizeNodes()
Gets the number of nodes in this graph. |
java.lang.String |
toString()
Creates a string representation of this graph. |
java.lang.String |
toString(java.lang.String shape)
Creates a string representation of this graph. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.LinkedList nodes
Node.protected java.lang.Object label
protected int curNumber
protected int sizeEdges
| Constructor Detail |
public Graph()
public Graph(java.lang.Object label)
| Method Detail |
public int sizeNodes()
public int sizeEdges()
public java.util.Iterator getNodes()
Iterator with all nodes of this graph;public void setLabel(java.lang.Object label)
public java.lang.Object getLabel()
Object which is the label of this graph.public java.lang.String toString(java.lang.String shape)
shape - A String for the shape of this nodespublic java.lang.String toString()
box.toString in class java.lang.Objectpublic static void main(java.lang.String[] args)
args - a value of type String[]
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||