*/
private IndexQuery makeRangeQuery() {
if (to.getClass().equals(String.class)) {
return new BinRangeQuery((BinIndex) index, bucket, (String) from, (String) to);
} else if (Number.class.isAssignableFrom(to.getClass())) {
return new IntRangeQuery((IntIndex) index, bucket,
((Number)from).longValue(), ((Number) to).longValue());
} else {
throw new RuntimeException("Unkown range query type " + to.getClass());
}
}