/** * Indicates if a unit is a time unit. * * @param unit The unit in question. * @return {@code true} if and only if {@code unit} is a time unit. * @Throws UnitSystemException if the unit system can't be initialized. */ private static boolean isTimeUnit(final Unit unit) throws UnitSystemException { return unit.isCompatible(UnitSystemManager.instance().getBaseUnit( BaseQuantity.TIME)); }
/** * Indicates if a unit is a time unit. * * @param unit The unit in question. * @return {@code true} if and only if {@code unit} is a time unit. * @Throws UnitSystemException if the unit system can't be initialized. */ private static boolean isTimeUnit(final Unit unit) throws UnitSystemException { return unit.isCompatible(UnitSystemManager.instance().getBaseUnit( BaseQuantity.TIME)); }
/** * Constructs from a reference unit, a time origin, and an identifier. * * @param unit The reference time unit. * @param origin The time origin. * @param id The identifier. * @throws BadUnitException <code>unit</code> is not a unit of time. */ public TimeScaleUnit(final Unit unit, final Date origin, final UnitName id) throws BadUnitException, UnitSystemException { super(id); if (!unit.isCompatible(UnitSystemManager.instance().getBaseUnit( BaseQuantity.TIME))) { throw new BadUnitException("\"" + unit + "\" is not a unit of time"); } _unit = unit; _origin = origin; }
/** * Constructs from a reference unit, a time origin, and an identifier. * * @param unit The reference time unit. * @param origin The time origin. * @param id The identifier. * @throws BadUnitException <code>unit</code> is not a unit of time. */ public TimeScaleUnit(final Unit unit, final Date origin, final UnitName id) throws BadUnitException, UnitSystemException { super(id); if (!unit.isCompatible(UnitSystemManager.instance().getBaseUnit( BaseQuantity.TIME))) { throw new BadUnitException("\"" + unit + "\" is not a unit of time"); } _unit = unit; _origin = origin; }