DirectedGraph { public Set<Vertex<E>> from(final Vertex<E> v) throws DirectedGraphException { Set<Vertex<E>> result = new HashSet<Vertex<E>>(); from2(v, result); return result; } DirectedGraph(); Vector<String> listEdges(); void addVertex(Vertex<E> v); void addEdge(Vertex<E> a, Vertex<E> b); void addEdge(Vertex<E> a, Vertex<E> b, F data); void addEdge(String aLabel, String bLabel); void addEdge(String aLabel, String bLabel, F data); F getEdgeData(Vertex<E> v1, Vertex<E> v2); Vector<F> getAllEdgeData(Vertex<E> v1, Vertex<E> v2); F getEdgeData(E vData1, E vData2); Vector<F> getAllEdgeData(E vData1, E vData2); boolean isStronglyConnected(); boolean isConnected(); Vector<Vertex<E>> getAdjacentVertices(final Vertex<E> v); void removeVertex(final Vertex<E> v); Vector<Vertex<E>> topoSort(final Vertex<E> v); Vector<Vertex<E>> topoSort(final String vLabel); Vertex<E> getVertexByLabel(final String vLabel); Vertex<E> getVertexByData(final E vData); Set<Vertex<E>> sources(); Set<Vertex<E>> from(final Vertex<E> v); Set<Vertex<E>> from(E vData); Set<Vertex<E>> to(Vertex<E> v); Set<Vertex<E>> to(E vData); Set<Vertex<E>> into(Vertex<E> v); Set<Vertex<E>> into(E vData); Vector<Vertex<E>> getTopoSort(); final Set<Vertex<E>> getVertices(); final Set<Edge<E, F>> getEdges();  }
@Test public void testFrom() { try { Set<Vertex<String>> froms = connect.from(a); assertTrue(froms.contains(c)); assertTrue(froms.contains(b)); froms = disConnect.from(a); assertTrue(!froms.contains(b)); froms = connect.from(b); assertTrue(froms.contains(d)); } catch (DirectedGraphException ex) { edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(DirectedGraphTest.class, ex); } }