/** * Creates a date range from the specified measurement range. Units are converted as needed. * * @param range The range to convert. * @param origin The date to use as the origin. * @throws IncommensurableException * @throws ConversionException if the given range doesn't have a {@linkplain * MeasurementRange#getUnits unit} compatible with milliseconds. */ public DateRange(final MeasurementRange<?> range, final Date origin) throws IncommensurableException { this(range, getConverter((Unit<Time>) range.getUnits()), origin.getTime()); }
/** * Creates a date range from the specified measurement range. Units are converted as needed. * * @param range The range to convert. * @param origin The date to use as the origin. * @throws ConversionException if the given range doesn't have a * {@linkplain MeasurementRange#getUnits unit} compatible with milliseconds. */ public DateRange(final MeasurementRange<?> range, final Date origin) throws ConversionException { this(range, getConverter(range.getUnits()), origin.getTime()); }