
de.uni.freiburg.iig.telematik.jagal.graph.Graph Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JAGAL Show documentation
Show all versions of JAGAL Show documentation
JAGAL provides implementations for directed graphs (weighted and unweighted) and various types of transition systems as well as utils for graph traversal and modification.
The newest version!
package de.uni.freiburg.iig.telematik.jagal.graph;
import java.util.Collection;
import de.invation.code.toval.validate.ParameterException;
import de.uni.freiburg.iig.telematik.jagal.graph.abstr.AbstractGraph;
public class Graph extends AbstractGraph, Edge>, T> {
public Graph(){
super();
}
public Graph(String name) throws ParameterException{
super(name);
}
public Graph(Collection vertexNames) throws ParameterException{
super(vertexNames);
}
public Graph(String name, Collection vertexNames) throws ParameterException{
super(name, vertexNames);
}
@Override
protected Vertex createNewVertex(String name, T element) {
return new Vertex<>(name, element);
}
@Override
protected Edge> createNewEdge(Vertex sourceVertex, Vertex targetVertex) {
return new Edge<>(sourceVertex, targetVertex);
}
public static void main(String[] args) throws Exception {
Graph g = new Graph<>();
g.addVertex("v1");
g.addVertex("v2");
g.addEdge("v1", "v2");
System.out.println(g);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy