private void polygonize(){
  if (polyList != null)   return;
  polyList=new ArrayList();
  if (graph == null)   return;
  dangles=graph.deleteDangles();
  cutEdges=graph.deleteCutEdges();
  List edgeRingList=graph.getEdgeRings();
  List validEdgeRingList=new ArrayList();
  invalidRingLines=new ArrayList();
  if (isCheckingRingsValid) {
    findValidRings(edgeRingList,validEdgeRingList,invalidRingLines);
  }
 else {
    validEdgeRingList=edgeRingList;
  }
  findShellsAndHoles(validEdgeRingList);
  assignHolesToShells(holeList,shellList);
  Collections.sort(shellList,new EdgeRing.EnvelopeComparator());
  boolean includeAll=true;
  if (extractOnlyPolygonal) {
    findDisjointShells(shellList);
    includeAll=false;
  }
  polyList=extractPolygons(shellList,includeAll);
}

private void polygonize ( ) { if ( polyList != null ) return ; polyList = new ArrayList ( ) ; if ( graph == null ) return ; dangles = graph . deleteDangles ( ) ; cutEdges = graph . deleteCutEdges ( ) ; List edgeRingList = graph . getEdgeRings ( ) ; List validEdgeRingList = new ArrayList ( ) ; invalidRingLines = new ArrayList ( ) ; if ( isCheckingRingsValid ) { findValidRings ( edgeRingList , validEdgeRingList , invalidRingLines ) ; } else { validEdgeRingList = edgeRingList ; } findShellsAndHoles ( validEdgeRingList ) ; assignHolesToShells ( holeList , shellList ) ; Collections . sort ( shellList , new EdgeRing . EnvelopeComparator ( ) ) ; boolean includeAll = true ; if ( extractOnlyPolygonal ) { findDisjointShells ( shellList ) ; includeAll = false ; } polyList = extractPolygons ( shellList , includeAll ) ; }
performs the polygonization , if it has not already been carried out .
