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

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

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

public class SimpleUndirectedWeightedEdge {

	public static  UndirectedWeightedEdge create(final V v1, final V v2, final W weight) {
		return new UndirectedWeightedEdge() {

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

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

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

			@Override
			public String toString() {
				return v1 + "-" + v2 + "(" + weight + ")";
			}
		};
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy