code: public static ConstantRange newInstance(Constant low, boolean lowIncl,
  			Constant high, boolean highIncl) {
  		if (low != null && high != null
  				&& !low.getType().equals(high.getType()))
  			throw new IllegalArgumentException();
  
  		Type type = low != null ? low.getType() : high.getType();
  		if (type.isNumeric()) {
  			DoubleConstant lowDouble = low != null ? (DoubleConstant) low
  					.castTo(DOUBLE) : null;
  			DoubleConstant highDouble = high != null ? (DoubleConstant) high
  					.castTo(DOUBLE) : null;
  			return new DoubleConstantRange(lowDouble, lowIncl, highDouble,
  					highIncl);
  		} else if (type.getSqlType() == VARCHAR.getSqlType()) {
  			VarcharConstant lowVarchar = low != null ? (VarcharConstant) low
  					: null;
  			VarcharConstant highVarchar = high != null ? (VarcharConstant) high
  					: null;
  			return new VarcharConstantRange(lowVarchar, lowIncl,
  					(VarcharConstant) highVarchar, highIncl);
  		}
  
  		throw new UnsupportedOperationException();
  	}
docs: Constructs a new instance. If the bounds are numeric, they will be
  converted to {@link DoubleConstant}s and an instance of
  {@link DoubleConstantRange} will be returned. Otherwise of the bounds are
  of string types, an instance of {@link VarcharConstantRange} will be
  returned.
  
  @param low
  the lower bound. <code>null</code> means unbound. Note that
  <code>low</code> and <code>high</code> cannot be both
  <code>null</code>.
  @param lowIncl
  whether the lower bound is inclusive
  @param high
  the higher bound. <code>null</code> means unbound. Note that
  <code>low</code> and <code>high</code> cannot be both
  <code>null</code>.
  @param highIncl
  whether the higher bound is inclusive
  @return a new instance