![]() |
AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
|
Interface to nodes of a graph. More...
Public Member Functions | |
abstract AbstractNode | create () |
Create new node instance. More... | |
AbstractGraph<? extends AbstractNode,? extends AbstractEdge > | graph () |
get graph More... | |
int | index () |
get index, i.e., unique integer id within graph More... | |
String | getLabel () |
get text description More... | |
void | setLabel (String label) |
set label (if supported) More... | |
void | setPosition (double x, double y) |
helper for drawing the graph (if supported) More... | |
double[] | getPosition () |
helper for drawing the graph: return {x,y} as array or null More... | |
GraphvizDecorator | getDecorator () |
get decoration or null More... | |
String | toString () |
int | compareTo (AbstractNode other) |
boolean | equals (Object other) |
GraphvizDecorator | getDecorator () |
get decoration or null More... | |
Interface to nodes of a graph.
Note that some operations require reimplementation (or throw UnsupportedOperationException
.
Definition at line 11 of file AbstractNode.java.
int aud.graph.AbstractNode.compareTo | ( | AbstractNode | other | ) |
Definition at line 52 of file AbstractNode.java.
Referenced by aud.graph.AbstractNode.equals().
|
abstract |
Create new node instance.
Must initialize any attributes introduced in subclasses of AbstractNode
.
Reimplemented in aud.example.graph.MyNode, and aud.graph.SimpleNode.
boolean aud.graph.AbstractNode.equals | ( | Object | other | ) |
Definition at line 57 of file AbstractNode.java.
References aud.graph.AbstractNode.compareTo().
GraphvizDecorator aud.graph.AbstractNode.getDecorator | ( | ) |
get decoration or null
Implements aud.util.GraphvizDecorable.
Definition at line 46 of file AbstractNode.java.
String aud.graph.AbstractNode.getLabel | ( | ) |
get text description
Reimplemented in aud.graph.SimpleNode.
Definition at line 31 of file AbstractNode.java.
Referenced by aud.graph.AbstractNode.toString().
double[] aud.graph.AbstractNode.getPosition | ( | ) |
helper for drawing the graph: return {x,y} as array or null
Reimplemented in aud.graph.SimpleNode.
Definition at line 44 of file AbstractNode.java.
AbstractGraph<? extends AbstractNode,? extends AbstractEdge > aud.graph.AbstractNode.graph | ( | ) |
get graph
Definition at line 25 of file AbstractNode.java.
Referenced by aud.test.GraphTest.testDirectedGraph(), and aud.test.GraphTest.testUndirectedGraph().
int aud.graph.AbstractNode.index | ( | ) |
get index, i.e., unique integer id within graph
Definition at line 29 of file AbstractNode.java.
void aud.graph.AbstractNode.setLabel | ( | String | label | ) |
set label (if supported)
Reimplemented in aud.graph.SimpleNode.
Definition at line 34 of file AbstractNode.java.
void aud.graph.AbstractNode.setPosition | ( | double | x, |
double | y | ||
) |
helper for drawing the graph (if supported)
Reimplemented in aud.graph.SimpleNode.
Definition at line 40 of file AbstractNode.java.
String aud.graph.AbstractNode.toString | ( | ) |
Reimplemented in aud.example.graph.MyNode.
Definition at line 50 of file AbstractNode.java.
References aud.graph.AbstractNode.getLabel().