org.psjava.ds.graph.SimpleDirectedWeightedEdge 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;
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