org.psjava.ds.graph.MutableDirectedGraph 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
The newest version!
package org.psjava.ds.graph;
import org.psjava.ds.Collection;
public class MutableDirectedGraph> implements Graph {
public static > MutableDirectedGraph create() {
return new MutableDirectedGraph();
}
private MutableGraph graph = MutableGraph.create();
public void insertVertex(V v) {
graph.insertVertex(v);
}
public void addEdge(E edge) {
graph.addEdge(edge.from(), edge);
}
@Override
public Collection getVertices() {
return graph.getVertices();
}
@Override
public Iterable getEdges(V v) {
return graph.getEdges(v);
}
@Override
public String toString() {
return graph.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy