public void partitionDouble(FieldInfo fieldInfo, int partitions) {
		FieldIterator iter = getFieldIterator(fieldInfo);
		
		ArrayList<Double> values = new ArrayList<Double>();
		ArrayList<Double> boundaries = new ArrayList<Double>();
		
		// first pass, generate partition boundary
		while (iter.hasNext()) {
			Field f = iter.next();
			values.add(Double.parseDouble(f.getRaw()));
	
		}
		Collections.sort(values);
		
		int interval = records.size() / partitions;
		
		assert(interval > 0);
		
		double endpoint = 0;
		for (int i = 0; i < partitions; i++) {
			
			if (i == partitions - 1)
				endpoint = values.get(values.size() - 1);
			else
				endpoint = values.get((i+1) * interval);
			boundaries.add(endpoint);
		}
		
		// second pass, generate mapping		
		iter = getFieldIterator(fieldInfo);
		while (iter.hasNext()) {
			Field f = iter.next();		
			double v = Double.parseDouble(f.getRaw());
			int idx = 0;
			while (boundaries.get(idx) < v) {
				idx++;
			}
			f.setRaw(Integer.toString(idx));
		}
		
		try {
			BufferedWriter writer = new BufferedWriter(new FileWriter("data/" + fieldInfo.getName() + ".range"));
			writer.write(values.get(0).toString());
			writer.newLine();
			for (Double i : boundaries) {
				writer.write(i.toString());
				writer.newLine();
			}
			writer.close();
		}
		catch (IOException e) {
			e.printStackTrace();
		}
		
	}