
de.uni.freiburg.iig.telematik.jagal.graph.weighted.WeightedGraph Maven / Gradle / Ivy
package de.uni.freiburg.iig.telematik.jagal.graph.weighted;
import java.util.Collection;
import de.invation.code.toval.validate.ParameterException;
import de.uni.freiburg.iig.telematik.jagal.graph.Vertex;
public class WeightedGraph extends AbstractWeightedGraph, T>{
public WeightedGraph(){
super();
}
public WeightedGraph(String name) throws ParameterException{
super(name);
}
public WeightedGraph(Collection vertexNames) throws ParameterException{
super(vertexNames);
}
public WeightedGraph(Collection vertexNames, String name) throws ParameterException{
super(name, vertexNames);
}
@Override
protected Vertex createNewVertex(String name, T element) {
return new Vertex(name, element);
}
@Override
protected WeightedEdge> createNewEdge(Vertex sourceVertex, Vertex targetVertex) {
return new WeightedEdge>(sourceVertex, targetVertex);
}
public static void main(String[] args) throws Exception{
WeightedGraph g = new WeightedGraph();
g.addVertex("A");
g.addVertex("B");
g.addEdge("A", "B", 0.5);
System.out.println(g);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy