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