All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.psjava.ds.graph.SimpleDirectedWeightedEdge Maven / Gradle / Ivy

There is a newer version: 0.1.19
Show newest version
package org.psjava.ds.graph;

import org.psjava.ds.graph.DirectedWeightedEdge;

public class SimpleDirectedWeightedEdge {

	public static  DirectedWeightedEdge create(final V from, final V to, final W weight) {
		return new DirectedWeightedEdge() {

			@Override
			public V from() {
				return from;
			}

			@Override
			public V to() {
				return to;
			}

			@Override
			public W weight() {
				return weight;
			}

			@Override
			public String toString() {
				return from + "->" + to + "(" + weight + ")";
			}
		};
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy