@Test public void getVertex() { DirectedAcyclicGraph<String> graph = new DirectedAcyclicGraph<String>(); assertNull(graph.getVertex("hello")); Vertex<String> helloVertex = graph.addVertex("hello"); assertSame(helloVertex, graph.getVertex("hello")); }
@Override public Vertex<T> getVertex(T of) { return vertices.get(of); }
DirectedAcyclicGraph implements Graph<T> { @Override public Vertex<T> getVertex(T of) { return vertices.get(of); } }
DirectedAcyclicGraph implements Graph<T> { @Override public Vertex<T> getVertex(T of) { return vertices.get(of); } DirectedAcyclicGraph(); }
DirectedAcyclicGraph implements Graph<T> { @Override public Vertex<T> getVertex(T of) { return vertices.get(of); } DirectedAcyclicGraph(); @Override Vertex<T> addVertex(T of); @Override void addEdge(Vertex<T> from, Vertex<T> to); @Override void removeEdge(Vertex<T> from, Vertex<T> to); @Override Vertex<T> getVertex(T of); @Override boolean hasVertex(T of); @Override boolean hasEdge(Vertex<T> from, Vertex<T> to); @Override boolean isCyclic(); @Override List<Vertex<T>> getVertices(); @Override List<Vertex<T>> getRootVertices(); @Override String toString(); }
DirectedAcyclicGraph implements Graph<T> { @Override public Vertex<T> getVertex(T of) { return vertices.get(of); } DirectedAcyclicGraph(); @Override Vertex<T> addVertex(T of); @Override void addEdge(Vertex<T> from, Vertex<T> to); @Override void removeEdge(Vertex<T> from, Vertex<T> to); @Override Vertex<T> getVertex(T of); @Override boolean hasVertex(T of); @Override boolean hasEdge(Vertex<T> from, Vertex<T> to); @Override boolean isCyclic(); @Override List<Vertex<T>> getVertices(); @Override List<Vertex<T>> getRootVertices(); @Override String toString();  }