blob: abc3c720ad2bd78fb10b2443000612aa9d60baaf (
plain)
- 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(); }
- }
|