@Test public void testGetEdgesFrom () { Node node1 = mGraph.addNode ("node1"); Node node2 = mGraph.addNode ("node2"); Node node3 = mGraph.addNode ("node3"); assertTrue (mGraph.getEdgesFrom (node1).isEmpty ()); Edge edge1 = mGraph.addEdge ("node1", "node2"); Edge edge2 = mGraph.addEdge ("node1", "node3"); Edge edge3 = mGraph.addEdge ("node2", "node3"); Set<Edge> edges = mGraph.getEdgesFrom (node1); assertTrue (edges.contains (edge1)); assertTrue (edges.contains (edge2)); assertFalse (edges.contains (edge3)); }
public Set<Edge> getEdgesFrom (Node source) { Set<Edge> edgesFromSameSource = mEdgesBySource.get (source); return edgesFromSameSource == null ? new HashSet<Edge> () : edgesFromSameSource; }
DirectedGraph extends AttributeSetWithDefaultNodeAttributes { public Set<Edge> getEdgesFrom (Node source) { Set<Edge> edgesFromSameSource = mEdgesBySource.get (source); return edgesFromSameSource == null ? new HashSet<Edge> () : edgesFromSameSource; } }
DirectedGraph extends AttributeSetWithDefaultNodeAttributes { public Set<Edge> getEdgesFrom (Node source) { Set<Edge> edgesFromSameSource = mEdgesBySource.get (source); return edgesFromSameSource == null ? new HashSet<Edge> () : edgesFromSameSource; } DirectedGraph();  DirectedGraph(boolean concentrateEdges); }
DirectedGraph extends AttributeSetWithDefaultNodeAttributes { public Set<Edge> getEdgesFrom (Node source) { Set<Edge> edgesFromSameSource = mEdgesBySource.get (source); return edgesFromSameSource == null ? new HashSet<Edge> () : edgesFromSameSource; } DirectedGraph();  DirectedGraph(boolean concentrateEdges); void setConcentrateEdges(boolean value); boolean getConcentrateEdges(); void setRankDirection(RankDirection direction); RankDirection getRankDirection(); void setDistanceBetweenRanks(float distance); float getDistanceBetweenRanks(); void setDistanceBetweenNodes(float distance); float getDistanceBetweenNodes(); Node addNode(String name); Node addNode(String name, Cluster cluster); boolean hasNode(String name); Node getNode(String name); Node getRoot(); Iterator<Node> nodeIterator(); Edge addEdge(String sourceName, String targetName); Edge addEdge(Node source, String targetName); Edge addEdge(String sourceName, Node target); Edge addEdge(Node source, Node target); Edge addEdge(String sourceName, String targetName, String label); Edge addEdge(Node source, String targetName, String label); Edge addEdge(String sourceName, Node target, String label); Edge addEdge(Node source, Node target, String label); boolean hasEdge(Node source, Node target); Edge getEdge(Node source, Node target); Set<Edge> getEdgesFrom(Node source); Set<Edge> getEdgesTo(Node target); Set<Edge> getEdgesFromOrTo(Node node); Set<Node> getNeighbours(Node node, int distance); Cluster addCluster(String label); Cluster addCluster(String label, Cluster cluster); Cluster getCluster(String label); Rank addRank(String name, RankType type); Rank getRank(String name); }
DirectedGraph extends AttributeSetWithDefaultNodeAttributes { public Set<Edge> getEdgesFrom (Node source) { Set<Edge> edgesFromSameSource = mEdgesBySource.get (source); return edgesFromSameSource == null ? new HashSet<Edge> () : edgesFromSameSource; } DirectedGraph();  DirectedGraph(boolean concentrateEdges); void setConcentrateEdges(boolean value); boolean getConcentrateEdges(); void setRankDirection(RankDirection direction); RankDirection getRankDirection(); void setDistanceBetweenRanks(float distance); float getDistanceBetweenRanks(); void setDistanceBetweenNodes(float distance); float getDistanceBetweenNodes(); Node addNode(String name); Node addNode(String name, Cluster cluster); boolean hasNode(String name); Node getNode(String name); Node getRoot(); Iterator<Node> nodeIterator(); Edge addEdge(String sourceName, String targetName); Edge addEdge(Node source, String targetName); Edge addEdge(String sourceName, Node target); Edge addEdge(Node source, Node target); Edge addEdge(String sourceName, String targetName, String label); Edge addEdge(Node source, String targetName, String label); Edge addEdge(String sourceName, Node target, String label); Edge addEdge(Node source, Node target, String label); boolean hasEdge(Node source, Node target); Edge getEdge(Node source, Node target); Set<Edge> getEdgesFrom(Node source); Set<Edge> getEdgesTo(Node target); Set<Edge> getEdgesFromOrTo(Node node); Set<Node> getNeighbours(Node node, int distance); Cluster addCluster(String label); Cluster addCluster(String label, Cluster cluster); Cluster getCluster(String label); Rank addRank(String name, RankType type); Rank getRank(String name);  }