aboutsummaryrefslogtreecommitdiff
path: root/src/com.example.portfolio3/com/example/portfolio3/Edge.java
blob: f57af870b5c14b5dce022f55914742bfd2f2d28d (plain)
  1. package com.example.portfolio3;
  2. // origin: <https://moodle.ruc.dk/course/section.php?id=211877>
  3. /// foo
  4. public class Edge {
  5. /// foo
  6. private Vertex from;
  7. /// foo
  8. private Vertex to;
  9. /// foo
  10. private int weight;
  11. /// foo
  12. /// @return Vertex
  13. public final Vertex from() {
  14. return from;
  15. }
  16. /// foo
  17. /// @return Vertex
  18. public final Vertex to() {
  19. return to;
  20. }
  21. /// foo
  22. /// @return int
  23. public final int weight() {
  24. return weight;
  25. }
  26. /// foo
  27. /// @param from foo
  28. /// @param to foo
  29. /// @param w foo
  30. Edge(final Vertex from, final Vertex to, final int w) {
  31. this.from = from;
  32. this.to = to;
  33. weight = w;
  34. }
  35. /// foo
  36. /// @return String
  37. public final String toString() {
  38. return from.name() + " - " + weight + " -> " + to.name();
  39. }
  40. }