code: public double distinctValues(ConstantRange range) {
  		ConstantRange overlap = valRange.intersect(range);
  		if (!overlap.isValid())
  			return 0.0;
  
  		if (overlap.isConstant())
  			return 1.0;
  		double ret = distVals;
  		if (pcts != null)
  			ret *= pcts.percentage(range);
  		else {
  			if (valRange.isLowInclusive()
  					&& (overlap.low().compareTo(valRange.low()) > 0 || !range
  							.isLowInclusive()))
  				ret -= 1.0;
  			if (valRange.isHighInclusive()
  					&& (overlap.high().compareTo(valRange.high()) < 0 || !range
  							.isHighInclusive()))
  				ret -= 1.0;
  			ret *= overlap.length() / valRange.length();
  		}
  		return Math.max(ret, 1.0);
  	}
docs: Returns the estimated number of distinct values within the overlap of
  this instance's range and the specified range.
  <p>
  Assumes that:
  <ul>
  <li>There is always a matching value if the specified range overlaps the
  range of this bucket</li>
  <li>Values are uniformly distributed within this instance's range if
  percentiles are not provided.</li>
  </ul>
  
  @param range
  the specified range
  @return the estimated number of distinct values within the overlap of
  this instance's range and the specified range. No less than 1.0
  if the range overlaps the range of this bucket.