src/main/java/org/thegalactic/dgraph/ConcreteDGraph.java
public boolean removeNode(final Node<N> node) {
        if (this.containsNode(node)) {
            // Remove the edges (node,target) with key node in successors, and key target in predecessors
            for (final Edge<N, E> successor : this.successors.get(node)) {
                if (successor.getTarget().compareTo(node) != 0) {
                    for (final Edge<N, E> predecessor : this.predecessors.get(successor.getTarget())) {
                        if (predecessor.getSource().compareTo(node) == 0) {
                            this.predecessors.get(successor.getTarget()).remove(predecessor);
                        }
                    }
                }
                this.successors.remove(node);
            }
            // Remove the edges (source,node) with key node in predecessors, and key source in successors
            for (final Edge<N, E> predecessor : this.predecessors.get(node)) {
                if (predecessor.getSource().compareTo(node) != 0) {
                    for (final Edge<N, E> successor : this.successors.get(predecessor.getSource())) {
                        if (successor.getTarget().compareTo(node) == 0) {
                            this.successors.get(predecessor.getSource()).remove(successor);
                        }
                    }
                }
                this.predecessors.remove(node);
            }
            // Remove node
            this.nodes.remove(node);
            return true;
        }
        return false;
    }
/**
     * Removes the specified node from this component.
     *
     * @param node the node to remove
     *
     * @return true if the node was successfully removed
     */
Removes the specified node from this component.
@param node the node to remove

@return true if the node was successfully removed
Removes the specified node from this component . @param node the node to remove @return true if the node was successfully removed
public boolean removeNode(final Node<N> node) {
        if (this.containsNode(node)) {
            for (final Edge<N, E> successor : this.successors.get(node)) {
                if (successor.getTarget().compareTo(node) != 0) {
                    for (final Edge<N, E> predecessor : this.predecessors.get(successor.getTarget())) {
                        if (predecessor.getSource().compareTo(node) == 0) {
                            this.predecessors.get(successor.getTarget()).remove(predecessor);
                        }
                    }
                }
                this.successors.remove(node);
            }
            for (final Edge<N, E> predecessor : this.predecessors.get(node)) {
                if (predecessor.getSource().compareTo(node) != 0) {
                    for (final Edge<N, E> successor : this.successors.get(predecessor.getSource())) {
                        if (successor.getTarget().compareTo(node) == 0) {
                            this.successors.get(predecessor.getSource()).remove(successor);
                        }
                    }
                }
                this.predecessors.remove(node);
            }
            this.nodes.remove(node);
            return true;
        }
        return false;
    }
public boolean removeNode ( final Node < N > node ) { if ( this . containsNode ( node ) ) { for ( final Edge < N , E > successor : this . successors . get ( node ) ) { if ( successor . getTarget ( ) . compareTo ( node ) != 0 ) { for ( final Edge < N , E > predecessor : this . predecessors . get ( successor . getTarget ( ) ) ) { if ( predecessor . getSource ( ) . compareTo ( node ) == 0 ) { this . predecessors . get ( successor . getTarget ( ) ) . remove ( predecessor ) ; } } } this . successors . remove ( node ) ; } for ( final Edge < N , E > predecessor : this . predecessors . get ( node ) ) { if ( predecessor . getSource ( ) . compareTo ( node ) != 0 ) { for ( final Edge < N , E > successor : this . successors . get ( predecessor . getSource ( ) ) ) { if ( successor . getTarget ( ) . compareTo ( node ) == 0 ) { this . successors . get ( predecessor . getSource ( ) ) . remove ( successor ) ; } } } this . predecessors . remove ( node ) ; } this . nodes . remove ( node ) ; return true ; } return false ; }
Removes the specified node from this component.
Removes the specified node from this component .
// Remove the edges (node,target) with key node in successors, and key target in predecessors // Remove the edges (source,node) with key node in predecessors, and key source in successors // Remove node