@Override public double getScale() { return getReferencedObject().getScale(); }
/** * Convert a value in this unit to the given unit if possible. * * @param value * to be converted * @param targetUnit * to convert to * @return the converted value or the same value if this unit equals given unit. * @throws IllegalArgumentException * if no conversion can be applied. */ public final double convert( final double value, final IUnit targetUnit ) { if ( this.equals( targetUnit ) ) { return value; } if ( canConvert( targetUnit ) ) { return ( value * scale ) / targetUnit.getScale(); } throw new IllegalArgumentException( "Can't convert from \"" + this + "\" to \"" + targetUnit + "\"." ); }