@Override public Collection<Point> getOutgoingConnections(Point node) { return delegate.getOutgoingConnections(node); }
@Override public Collection<Point> getOutgoingConnections(Point node) { return delegate.getOutgoingConnections(node); }
@Override public Collection<Point> getOutgoingConnections(Point node) { return Collections.unmodifiableCollection(delegate .getOutgoingConnections(node)); }
@Override public Collection<Point> getOutgoingConnections(Point node) { return Collections.unmodifiableCollection(delegate .getOutgoingConnections(node)); }
for (final Point outgoingPoint : graph.getOutgoingConnections(current)) { if (closedSet.contains(outgoingPoint)) { continue;
for (final Point outgoingPoint : graph.getOutgoingConnections(current)) { if (closedSet.contains(outgoingPoint)) { continue;
@Override public void removeNode(Point node) { // collect data of removed connections but only if there is a listener final List<Connection<?>> removedConnections = newArrayList(); if (eventDispatcher.hasListenerFor(EventTypes.REMOVE_CONNECTION)) { for (final Point p : delegate.getIncomingConnections(node)) { removedConnections.add(delegate.getConnection(p, node)); } for (final Point p : delegate.getOutgoingConnections(node)) { removedConnections.add(delegate.getConnection(node, p)); } } delegate.removeNode(node); // notify listeners for (final Connection<?> c : removedConnections) { eventDispatcher.dispatchEvent(new GraphEvent( EventTypes.REMOVE_CONNECTION, this, c)); } }
@Override public void removeNode(Point node) { // collect data of removed connections but only if there is a listener final List<Connection<?>> removedConnections = newArrayList(); if (eventDispatcher.hasListenerFor(EventTypes.REMOVE_CONNECTION)) { for (final Point p : delegate.getIncomingConnections(node)) { removedConnections.add(delegate.getConnection(p, node)); } for (final Point p : delegate.getOutgoingConnections(node)) { removedConnections.add(delegate.getConnection(node, p)); } } delegate.removeNode(node); // notify listeners for (final Connection<?> c : removedConnections) { eventDispatcher.dispatchEvent(new GraphEvent( EventTypes.REMOVE_CONNECTION, this, c)); } }
conns.addAll(graph.getOutgoingConnections(p));
@Test public void outgoingConnectionsOrder() { final Point outgoing = new Point(0, 0); final Point p0 = new Point(1, 0); final Point p1 = new Point(2, 0); final Point p2 = new Point(3, 0); final Point p3 = new Point(4, 0); final Point p4 = new Point(5, 0); final Point p5 = new Point(6, 0); final List<Point> points = Arrays.asList(p0, p1, p2, p3, p4, p5); for (final Point p : points) { graph.addConnection(outgoing, p); } final List<Point> outgoingConn = new ArrayList<Point>( graph.getOutgoingConnections(outgoing)); for (int i = 0; i < outgoingConn.size(); i++) { assertSame(outgoingConn.get(i), points.get(i)); } }