<commit_before>package com.nutiteq.layers.vector;

import java.util.LinkedList;
import java.util.Vector;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.net.ParseException;
import android.net.Uri;

import com.nutiteq.components.Components;
import com.nutiteq.components.Envelope;
import com.nutiteq.components.MapPos;
import com.nutiteq.geometry.Geometry;
import com.nutiteq.geometry.Polygon;
import com.nutiteq.log.Log;
import com.nutiteq.projections.Projection;
import com.nutiteq.style.PolygonStyle;
import com.nutiteq.style.StyleSet;
import com.nutiteq.tasks.CancelableThreadPoolExecutor;
import com.nutiteq.tasks.Task;
import com.nutiteq.tasks.TaskPoolThreadFactory;
import com.nutiteq.ui.DefaultLabel;
import com.nutiteq.utils.NetUtils;
import com.nutiteq.vectorlayers.GeometryLayer;

/**
 * Shows Drive Time region for given location
 * @author jaak
 *
 */
public class DriveTimeRegionLayer extends GeometryLayer {

 	private StyleSet<PolygonStyle> polygonStyleSet;
    private MapPos mapPos;
    private float distance;
    private Activity activity;
    private LinkedList<Geometry> currentVisibleElementsList = new LinkedList<Geometry>();
//    private final CancelableThreadPool dataPool = new CancelableThreadPool(1);
    private final CancelableThreadPoolExecutor dataPool = new CancelableThreadPoolExecutor(1, 1, 0, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new TaskPoolThreadFactory("Data"));

    protected class LoadDataTask implements Task {
        final MapPos pos;
        final float distance;
        
        LoadDataTask(MapPos pos, float distance) {
          this.pos = pos;<commit_msg>compatible with SDK 2.2.1 API change<commit_after>package com.nutiteq.layers.vector;

import java.util.LinkedList;
import java.util.Vector;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.app.Activity;
import android.net.ParseException;
import android.net.Uri;

import com.nutiteq.components.Components;
import com.nutiteq.components.Envelope;
import com.nutiteq.components.MapPos;
import com.nutiteq.geometry.Geometry;
import com.nutiteq.geometry.Polygon;
import com.nutiteq.log.Log;
import com.nutiteq.projections.Projection;
import com.nutiteq.style.PolygonStyle;
import com.nutiteq.style.StyleSet;
import com.nutiteq.tasks.CancelableThreadPool;
import com.nutiteq.tasks.Task;
import com.nutiteq.ui.DefaultLabel;
import com.nutiteq.utils.NetUtils;
import com.nutiteq.vectorlayers.GeometryLayer;

/**
 * Shows Drive Time region for given location
 * @author jaak
 *
 */
public class DriveTimeRegionLayer extends GeometryLayer {

 	private StyleSet<PolygonStyle> polygonStyleSet;
    private MapPos mapPos;
    private float distance;
    private Activity activity;
    private LinkedList<Geometry> currentVisibleElementsList = new LinkedList<Geometry>();
    private final CancelableThreadPool dataPool = new CancelableThreadPool(1);
//    private final CancelableThreadPoolExecutor dataPool = new CancelableThreadPoolExecutor(1, 1, 0, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new TaskPoolThreadFactory("Data"));

    protected class LoadDataTask implements Task {
        final MapPos pos;
        final float distance;
        
        LoadDataTask(MapPos pos, float distance) {
          this.pos = pos;
{'fraction_non_alphanumeric': 0.08725602755453502, 'fraction_numerical': 0.0031572904707233064, 'mean_word_length': 5.0820244328097735, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5834691', 'n_tokens_mistral': 1040, 'n_tokens_neox': 1020, 'n_words': 236}