public int getIndex(double value) {
		if (value < boundaries[0]) {
			return 0;
		} else if (value >= boundaries[boundaries.length - 1]) {
			return boundaries.length - 1;
		} else {
			int idx = Arrays.binarySearch(boundaries, value);
			if (idx < 0) {
				idx = -idx - 1;
			}
			return idx;
		}
	}