]> git.gag.com Git - debian/openrocket/commitdiff
Added UnitGroup.fromUnit which delegates to UnitGroup.getDefaultUnit().fromUnit.
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Mon, 4 Jun 2012 19:17:05 +0000 (19:17 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Mon, 4 Jun 2012 19:17:05 +0000 (19:17 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@750 180e2498-e6e9-4542-8430-84ac67f01cd8

core/src/net/sf/openrocket/unit/UnitGroup.java

index 67140bad1235a7c9b547f64e597e21ae3754863a..75774dc1c3d1d4eeba29ca7746cd5a445d2b11cb 100644 (file)
@@ -458,6 +458,17 @@ public class UnitGroup {
                return units.toArray(new Unit[0]);
        }
        
+       /**
+        * Return the value in SI units from the default unit of this group.
+        * It is the same as calling <code>getDefaultUnit().fromUnit(value)</code>
+        * 
+        * @param value the default unit value to convert
+        * @return the value in SI units.
+        * @see Unit#fromUnit(double)
+        */
+       public double fromUnit( double value ) {
+               return this.getDefaultUnit().fromUnit(value);
+       }
        
        /**
         * Return the value formatted by the default unit of this group.