aboutsummaryrefslogtreecommitdiff
path: root/src/com.example.portfolio3/com/example/portfolio3/Edge.java
blob: f5d54dbff97d67b1e089ed21c31ebe70ee766dec (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,to;
  7. /// foo
  8. private int weight;
  9. /// foo
  10. /// @return Vertex
  11. public Vertex from(){return from;}
  12. /// foo
  13. /// @return Vertex
  14. public Vertex to(){return to;}
  15. /// foo
  16. /// @return int
  17. public int weight(){return weight;}
  18. /// foo
  19. /// @param from foo
  20. /// @param to foo
  21. /// @param w foo
  22. Edge(Vertex from,Vertex to,int w){this.from=from; this.to=to; weight=w;}
  23. /// foo
  24. /// @return String
  25. public String toString(){return from.name()+" - "+weight+" -> "+to.name(); }
  26. }