private void addEndpoints(){
  int maxSegIndex=edge.size() - 1;
  add(edge.getCoordinate(0),0);
  add(edge.getCoordinate(maxSegIndex),maxSegIndex);
}

private void addEndpoints ( ) { int maxSegIndex = edge . size ( ) - 1 ; add ( edge . getCoordinate ( 0 ) , 0 ) ; add ( edge . getCoordinate ( maxSegIndex ) , maxSegIndex ) ; }
adds nodes for the first and last points of the edge
