![]() |
AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
|
Interface to edges of a graph. More...
Public Member Functions | |
abstract AbstractEdge | create () |
Create new edge instance. More... | |
AbstractGraph<? extends AbstractNode,? extends AbstractEdge > | graph () |
get graph More... | |
AbstractNode | source () |
Get source node. More... | |
AbstractNode | destination () |
get destination node More... | |
boolean | hasWeight () |
determine if edge weight is defined More... | |
double | getWeight () |
set edge weight More... | |
void | setWeight (double w) |
set weight More... | |
String | getLabel () |
get text description or null if there is none More... | |
GraphvizDecorator | getDecorator () |
get decoration or null More... | |
String | toString () |
int | compareTo (AbstractEdge other) |
boolean | equals (Object other) |
GraphvizDecorator | getDecorator () |
get decoration or null More... | |
Interface to edges of a graph.
Note that some operations require reimplementation (or throw UnsupportedOperationException
.
Definition at line 11 of file AbstractEdge.java.
int aud.graph.AbstractEdge.compareTo | ( | AbstractEdge | other | ) |
Definition at line 83 of file AbstractEdge.java.
Referenced by aud.graph.AbstractEdge.equals().
|
abstract |
Create new edge instance.
Must initialize any attributes introduced in subclasses of AbstractEdge
.
Reimplemented in aud.example.graph.MyEdge, and aud.graph.SimpleEdge.
AbstractNode aud.graph.AbstractEdge.destination | ( | ) |
get destination node
Definition at line 39 of file AbstractEdge.java.
Referenced by aud.test.GraphTest.testDirectedGraph().
boolean aud.graph.AbstractEdge.equals | ( | Object | other | ) |
Definition at line 89 of file AbstractEdge.java.
References aud.graph.AbstractEdge.compareTo().
GraphvizDecorator aud.graph.AbstractEdge.getDecorator | ( | ) |
get decoration or null
Implements aud.util.GraphvizDecorable.
Definition at line 71 of file AbstractEdge.java.
String aud.graph.AbstractEdge.getLabel | ( | ) |
get text description or null
if there is none
Reimplemented in aud.graph.SimpleEdge.
Definition at line 57 of file AbstractEdge.java.
References aud.graph.AbstractEdge.getWeight(), and aud.graph.AbstractEdge.hasWeight().
Referenced by aud.graph.AbstractEdge.toString().
double aud.graph.AbstractEdge.getWeight | ( | ) |
set edge weight
Reimplemented in aud.graph.SimpleEdge.
Definition at line 47 of file AbstractEdge.java.
Referenced by aud.graph.AbstractEdge.getLabel(), and aud.graph.AbstractEdge.hasWeight().
AbstractGraph<? extends AbstractNode,? extends AbstractEdge > aud.graph.AbstractEdge.graph | ( | ) |
get graph
Definition at line 26 of file AbstractEdge.java.
Referenced by aud.test.GraphTest.testDirectedGraph(), and aud.test.GraphTest.testUndirectedGraph().
boolean aud.graph.AbstractEdge.hasWeight | ( | ) |
determine if edge weight is defined
Definition at line 42 of file AbstractEdge.java.
References aud.graph.AbstractEdge.getWeight().
Referenced by aud.graph.AbstractEdge.getLabel(), aud.example.graph.DijkstraShortestPaths.priority(), aud.example.graph.PrimMinimumSpanningTree.priority(), and aud.example.graph.IterativeDFS1.start().
void aud.graph.AbstractEdge.setWeight | ( | double | w | ) |
set weight
UnsupportedOperationException | if edges are not weighted (link hasWeight} returns false ) |
Reimplemented in aud.graph.SimpleEdge.
Definition at line 52 of file AbstractEdge.java.
AbstractNode aud.graph.AbstractEdge.source | ( | ) |
Get source node.
For undirected graphs always source.index()<=destination.index()
.
Definition at line 35 of file AbstractEdge.java.
Referenced by aud.test.GraphTest.testDirectedGraph().
String aud.graph.AbstractEdge.toString | ( | ) |
Definition at line 75 of file AbstractEdge.java.
References aud.graph.AbstractEdge.getLabel().