diff options
Diffstat (limited to 'com/example/portfolio3/Edge.java')
-rw-r--r-- | com/example/portfolio3/Edge.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/com/example/portfolio3/Edge.java b/com/example/portfolio3/Edge.java new file mode 100644 index 0000000..abc3c72 --- /dev/null +++ b/com/example/portfolio3/Edge.java @@ -0,0 +1,37 @@ +package com.example.portfolio3; + +// origin: <https://moodle.ruc.dk/course/section.php?id=211877> + +import java.util.*; + +/// foo +class Edge{ + + /// foo + private Vertex from,to; + + /// foo + private int weight; + + /// foo + /// @return Vertex + public Vertex from(){return from;} + + /// foo + /// @return Vertex + public Vertex to(){return to;} + + /// foo + /// @return int + public int weight(){return weight;} + + /// foo + /// @param from foo + /// @param to foo + /// @param w foo + Edge(Vertex from,Vertex to,int w){this.from=from; this.to=to; weight=w;} + + /// foo + /// @return String + public String toString(){return from.name()+" - "+weight+" -> "+to.name(); } +} |