public void removeSecondaryEdge(ComparableNode source, ComparableNode target) throws MaltChainedException { if (source == null || target == null) { throw new SyntaxGraphException("Head or dependent node is missing."); } else if (!target.isRoot()) { final Iterator<Edge> ie = ((Node)target).getIncomingEdgeIterator(); while (ie.hasNext()) { Edge e = ie.next(); if (e.getSource() == source) { ie.remove(); graphEdges.remove(e); edgePool.checkIn(e); } } } }
public void removeSecondaryEdge(ComparableNode source, ComparableNode target) throws MaltChainedException { if (source == null || target == null) { throw new SyntaxGraphException("Head or dependent node is missing."); } else if (!target.isRoot()) { Iterator<Edge> ie = ((Node)target).getIncomingEdgeIterator(); while (ie.hasNext()) { Edge e = ie.next(); if (e.getSource() == source) { ie.remove(); graphEdges.remove(e); edgePool.checkIn(e); } } } }
protected void removeDependencyEdge(Node head, Node dependent) throws MaltChainedException { if (head == null || dependent == null) { throw new SyntaxGraphException("Head or dependent node is missing."); } else if (!dependent.isRoot()) { Iterator<Edge> ie = dependent.getIncomingEdgeIterator(); while (ie.hasNext()) { Edge e = ie.next(); if (e.getSource() == head) { graphEdges.remove(e); ie.remove(); edgePool.checkIn(e); } } } else { throw new SyntaxGraphException("Head node is not a root node or a terminal node."); } }
public void removeSecondaryEdge(ComparableNode source, ComparableNode target) throws MaltChainedException { if (source == null || target == null || source.getBelongsToGraph() != this || target.getBelongsToGraph() != this) { throw new SyntaxGraphException("Head or dependent node is missing."); } else if (!target.isRoot()) { Iterator<Edge> ie = ((Node)target).getIncomingEdgeIterator(); while (ie.hasNext()) { Edge e = ie.next(); if (e.getSource() == source) { ie.remove(); graphEdges.remove(e); edgePool.checkIn(e); } } } }
protected void removeDependencyEdge(Node head, Node dependent) throws MaltChainedException { if (head == null || dependent == null || head.getBelongsToGraph() != this || dependent.getBelongsToGraph() != this) { throw new SyntaxGraphException("Head or dependent node is missing."); } else if (!dependent.isRoot()) { Iterator<Edge> ie = dependent.getIncomingEdgeIterator(); while (ie.hasNext()) { Edge e = ie.next(); if (e.getSource() == head) { ie.remove(); graphEdges.remove(e); edgePool.checkIn(e); } } } else { throw new SyntaxGraphException("Head node is not a root node or a terminal node."); } }