org.psjava.ds.graph.SimpleUndirectedWeightedEdge Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of psjava Show documentation
Show all versions of psjava Show documentation
Problem Solving Library for Java
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