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

plain simple edge More...

+ Inheritance diagram for aud.graph.SimpleEdge:
+ Collaboration diagram for aud.graph.SimpleEdge:

Public Member Functions

SimpleEdge create ()
 Create new edge instance. More...
 
String getLabel ()
 get text description or null if there is none More...
 
void setLabel (String label)
 set label (default label if label==null) More...
 
double getWeight ()
 set edge weight More...
 
void setWeight (double w)
 set weight More...
 
- Public Member Functions inherited from aud.graph.AbstractEdge
abstract AbstractEdge create ()
 Create new edge instance. More...
 
AbstractGraph<? extends AbstractNode,? extends AbstractEdgegraph ()
 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...
 
GraphvizDecorator getDecorator ()
 get decoration or null
More...
 
String toString ()
 
int compareTo (AbstractEdge other)
 
boolean equals (Object other)
 
GraphvizDecorator getDecorator ()
 get decoration or null
More...
 

Detailed Description

plain simple edge

Definition at line 4 of file SimpleEdge.java.

Member Function Documentation

◆ create()

SimpleEdge aud.graph.SimpleEdge.create ( )

Create new edge instance.

Must initialize any attributes introduced in subclasses of AbstractEdge.

Returns
edge instance

Reimplemented from aud.graph.AbstractEdge.

Reimplemented in aud.example.graph.MyEdge.

Definition at line 9 of file SimpleEdge.java.

9 {
10 return new SimpleEdge();
11 }

◆ getLabel()

String aud.graph.SimpleEdge.getLabel ( )

get text description or null if there is none

Reimplemented from aud.graph.AbstractEdge.

Definition at line 12 of file SimpleEdge.java.

12 {
13 return label_==null ? super.getLabel() : label_;
14 }

◆ getWeight()

double aud.graph.SimpleEdge.getWeight ( )

set edge weight

Returns
not-a-number (NaN) if undefined (default implementation)

Reimplemented from aud.graph.AbstractEdge.

Definition at line 19 of file SimpleEdge.java.

19{ return weight_; }

Referenced by aud.example.graph.DijkstraShortestPaths.priority(), aud.example.graph.PrimMinimumSpanningTree.priority(), and aud.example.graph.IterativeDFS1.start().

+ Here is the caller graph for this function:

◆ setLabel()

void aud.graph.SimpleEdge.setLabel ( String  label)

set label (default label if label==null)

Definition at line 17 of file SimpleEdge.java.

17{ label_=label; }

Referenced by aud.util.GraphDemo.main().

+ Here is the caller graph for this function:

◆ setWeight()

void aud.graph.SimpleEdge.setWeight ( double  w)

set weight

Exceptions
UnsupportedOperationExceptionif edges are not weighted (link hasWeight} returns false)

Reimplemented from aud.graph.AbstractEdge.

Definition at line 20 of file SimpleEdge.java.

20{ weight_=w; }

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