package com.example.portfolio3;

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

/// foo
public class Edge {

	/// foo
	private Vertex from;

	/// foo
	private Vertex to;

	/// foo
	private int weight;

	/// foo
	/// @return Vertex
	public final Vertex from() {
		return from;
	}

	/// foo
	/// @return Vertex
	public final Vertex to() {
		return to;
	}

	/// foo
	/// @return int
	public final int weight() {
		return weight;
	}

	/// foo
	/// @param from  foo
	/// @param to    foo
	/// @param w     foo
	Edge(final Vertex from, final Vertex to, final int w) {
		this.from = from;
		this.to = to;
		weight = w;
	}

	/// foo
	/// @return String
	public final String toString() {
		return from.name() + " - " + weight + " -> " + to.name();
	}
}