AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
aud.example.graph.MyNode Class Reference

node with all possible attributes that we require ;-) More...

+ Inheritance diagram for aud.example.graph.MyNode:
+ Collaboration diagram for aud.example.graph.MyNode:

Public Member Functions

MyNode create ()
 Create new node instance. More...
 
String toString ()
 
- Public Member Functions inherited from aud.graph.SimpleNode
SimpleNode create ()
 Create new node instance. More...
 
String getLabel ()
 get text description More...
 
void setLabel (String label)
 set label (default label if label==null) 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...
 
- Public Member Functions inherited from aud.graph.AbstractNode
abstract AbstractNode create ()
 Create new node instance. More...
 
AbstractGraph<? extends AbstractNode,? extends AbstractEdgegraph ()
 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...
 

Public Attributes

int ord = -1
 time when node is (first marked/put into front) More...
 
MyNode p = null
 node from which node was reached (defines spanning tree) More...
 
double d = Double.POSITIVE_INFINITY
 distance to start node (sum of weighs or edge count if no weights defined) More...
 
double f = Double.POSITIVE_INFINITY
 priority for A*-algorithm More...
 
String color = null
 color as string More...
 

Detailed Description

node with all possible attributes that we require ;-)

Definition at line 6 of file MyNode.java.

Member Function Documentation

◆ create()

MyNode aud.example.graph.MyNode.create ( )

Create new node instance.

Must initialize any attributes introduced in subclasses of AbstractNode.

Returns
node instance

Reimplemented from aud.graph.SimpleNode.

Definition at line 8 of file MyNode.java.

8 { // DON'T FORGET THIS !!!
9 return new MyNode();
10 }

◆ toString()

String aud.example.graph.MyNode.toString ( )

Reimplemented from aud.graph.AbstractNode.

Definition at line 34 of file MyNode.java.

34 {
35 return super.toString()+
36 " [p="+(p!=null?p.getLabel():"null")+", d="+d+fAsString(", ")+"]";
37 }
MyNode p
node from which node was reached (defines spanning tree)
Definition: MyNode.java:16
double d
distance to start node (sum of weighs or edge count if no weights defined)
Definition: MyNode.java:21
String getLabel()
get text description
Definition: SimpleNode.java:12

References aud.example.graph.MyNode.d, aud.graph.SimpleNode.getLabel(), and aud.example.graph.MyNode.p.

+ Here is the call graph for this function:

Member Data Documentation

◆ color

String aud.example.graph.MyNode.color = null

color as string

Definition at line 27 of file MyNode.java.

Referenced by aud.example.graph.TraversalExample.main(), and aud.example.graph.Traversal.showMark().

◆ d

◆ f

double aud.example.graph.MyNode.f = Double.POSITIVE_INFINITY

priority for A*-algorithm

Definition at line 24 of file MyNode.java.

◆ ord

int aud.example.graph.MyNode.ord = -1

◆ p

MyNode aud.example.graph.MyNode.p = null

node from which node was reached (defines spanning tree)

Definition at line 16 of file MyNode.java.

Referenced by aud.example.graph.IterativeDFS1.start(), and aud.example.graph.MyNode.toString().


The documentation for this class was generated from the following file: