private void findCollapsesFromInsertedNodes(List collapsedVertexIndexes){
  int[] collapsedVertexIndex=new int[1];
  Iterator it=iterator();
  SegmentNode eiPrev=(SegmentNode)it.next();
  while (it.hasNext()) {
    SegmentNode ei=(SegmentNode)it.next();
    boolean isCollapsed=findCollapseIndex(eiPrev,ei,collapsedVertexIndex);
    if (isCollapsed)     collapsedVertexIndexes.add(new Integer(collapsedVertexIndex[0]));
    eiPrev=ei;
  }
}

private void findCollapsesFromInsertedNodes ( List collapsedVertexIndexes ) { int [ ] collapsedVertexIndex = new int [ 1 ] ; Iterator it = iterator ( ) ; SegmentNode eiPrev = ( SegmentNode ) it . next ( ) ; while ( it . hasNext ( ) ) { SegmentNode ei = ( SegmentNode ) it . next ( ) ; boolean isCollapsed = findCollapseIndex ( eiPrev , ei , collapsedVertexIndex ) ; if ( isCollapsed ) collapsedVertexIndexes . add ( new Integer ( collapsedVertexIndex [ 0 ] ) ) ; eiPrev = ei ; } }
adds nodes for any collapsed edge pairs caused by inserted nodes collapsed edge pairs occur when the same coordinate is inserted as a node both before and after an existing edge vertex . to provide the correct fully noded semantics , the vertex must be added as a node as well .
