public SegmentPath complete(EndType etype){
  SegmentPath result;
  if (data == null || w < 6) {
    return null;
  }
  if (w == data.length) {
    result=new SegmentPath(data,etype);
    reset(0);
  }
 else {
    double[] dataToAdopt=new double[w];
    System.arraycopy(data,0,dataToAdopt,0,w);
    result=new SegmentPath(dataToAdopt,etype);
    reset(2);
  }
  return result;
}

public SegmentPath complete ( EndType etype ) { SegmentPath result ; if ( data == null || w < 6 ) { return null ; } if ( w == data . length ) { result = new SegmentPath ( data , etype ) ; reset ( 0 ) ; } else { double [ ] dataToAdopt = new double [ w ] ; System . arraycopy ( data , 0 , dataToAdopt , 0 , w ) ; result = new SegmentPath ( dataToAdopt , etype ) ; reset ( 2 ) ; } return result ; }
complete building a segmentpath . once this is called , the builder is restored to its initial state and information about the previous path is released . the end type indicates whether to treat the path as closed , extended , or pinned .
