public void grabTiles(Action builder){
  if (boundsList == null) {
    boundsList=new ArrayList<double[]>();
    boundsList.add(new double[]{80,-180,-80,180});
  }
  for (int i=0; i < ZOOM_LEVELS; i++) {
    if (zoomLevels == null) {
      if (i > 14)       continue;
    }
 else {
      if (!zoomLevels[i]) {
        continue;
      }
    }
    for (    double[] bounds : boundsList) {
      int[] uvBounds=mtcTransform.getTileBoundsForProjection(new LatLonPoint.Double(bounds[0],bounds[1]),new LatLonPoint.Double(bounds[2],bounds[3]),i);
      int uvup=uvBounds[0];
      int uvleft=uvBounds[1];
      int uvbottom=uvBounds[2];
      int uvright=uvBounds[3];
      int uvleftM=(int)Math.min(uvleft,uvright);
      int uvrightM=(int)Math.max(uvleft,uvright);
      int uvupM=(int)Math.min(uvbottom,uvup);
      int uvbottomM=(int)Math.max(uvbottom,uvup);
      for (int x=uvleftM; x < uvrightM; x++) {
        for (int y=uvupM; y < uvbottomM; y++) {
          builder.action(x,y,i,this);
        }
      }
    }
  }
}

public void grabTiles ( Action builder ) { if ( boundsList == null ) { boundsList = new ArrayList < double [ ] > ( ) ; boundsList . add ( new double [ ] { 80 , - 180 , - 80 , 180 } ) ; } for ( int i = 0 ; i < ZOOM_LEVELS ; i ++ ) { if ( zoomLevels == null ) { if ( i > 14 ) continue ; } else { if ( ! zoomLevels [ i ] ) { continue ; } } for ( double [ ] bounds : boundsList ) { int [ ] uvBounds = mtcTransform . getTileBoundsForProjection ( new LatLonPoint . Double ( bounds [ 0 ] , bounds [ 1 ] ) , new LatLonPoint . Double ( bounds [ 2 ] , bounds [ 3 ] ) , i ) ; int uvup = uvBounds [ 0 ] ; int uvleft = uvBounds [ 1 ] ; int uvbottom = uvBounds [ 2 ] ; int uvright = uvBounds [ 3 ] ; int uvleftM = ( int ) Math . min ( uvleft , uvright ) ; int uvrightM = ( int ) Math . max ( uvleft , uvright ) ; int uvupM = ( int ) Math . min ( uvbottom , uvup ) ; int uvbottomM = ( int ) Math . max ( uvbottom , uvup ) ; for ( int x = uvleftM ; x < uvrightM ; x ++ ) { for ( int y = uvupM ; y < uvbottomM ; y ++ ) { builder . action ( x , y , i , this ) ; } } } } }
figure out which tiles need action , based on settings . calls action . action ( ) for each tile on the builder . designed to be called from action . go ( ) .
