package com.example.portfolio3;

// origin: <https://moodle.ruc.dk/course/section.php?id=211877>

/// foo
public 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(); }
}