Changeset 10175 in josm for trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java
- Timestamp:
- 2016-05-10T17:56:23+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/SystemOfMeasurement.java
r8846 r10175 39 39 * @since 3406 40 40 */ 41 public static final SystemOfMeasurement METRIC = new SystemOfMeasurement(1, "m", 1000, "km", 10000, "ha"); 41 public static final SystemOfMeasurement METRIC = new SystemOfMeasurement(1, "m", 1000, "km", "km/h", 3.6, 10000, "ha"); 42 42 43 43 /** 44 44 * Chinese system. 45 * @since 3406 46 */ 47 public static final SystemOfMeasurement CHINESE = new SystemOfMeasurement(1.0/3.0, "\u5e02\u5c3a" /* chi */, 500, "\u5e02\u91cc" /* li */); 45 * See <a href="https://en.wikipedia.org/wiki/Chinese_units_of_measurement#Chinese_length_units_effective_in_1930">length units</a>, 46 * <a href="https://en.wikipedia.org/wiki/Chinese_units_of_measurement#Chinese_area_units_effective_in_1930">area units</a> 47 * @since 3406 48 */ 49 public static final SystemOfMeasurement CHINESE = new SystemOfMeasurement(1.0/3.0, "\u5e02\u5c3a" /* chi */, 500, "\u5e02\u91cc" /* li */, 50 "km/h", 3.6, 666.0 + 2.0/3.0, "\u4ea9" /* mu */); 48 51 49 52 /** … … 51 54 * @since 3406 52 55 */ 53 public static final SystemOfMeasurement IMPERIAL = new SystemOfMeasurement(0.3048, "ft", 1609.344, "mi", 4046.86, "ac"); 56 public static final SystemOfMeasurement IMPERIAL = new SystemOfMeasurement(0.3048, "ft", 1609.344, "mi", "mph", 2.23694, 4046.86, "ac"); 54 57 55 58 /** … … 57 60 * @since 5549 58 61 */ 59 public static final SystemOfMeasurement NAUTICAL_MILE = new SystemOfMeasurement(185.2, "kbl", 1852, "NM"); 62 public static final SystemOfMeasurement NAUTICAL_MILE = new SystemOfMeasurement(185.2, "kbl", 1852, "NM", "kn", 1.94384); 60 63 61 64 /** … … 138 141 /** Second unit used to format text. */ 139 142 public final String bName; 143 /** Speed value for the most common speed symbol, in meters per second 144 * @since 10175 */ 145 public final double speedValue; 146 /** Most common speed symbol (kmh/h, mph, kn, etc.) 147 * @since 10175 */ 148 public final String speedName; 140 149 /** Specific optional area value, in squared meters, between {@code aValue*aValue} and {@code bValue*bValue}. Set to {@code -1} if not used. 141 150 * @since 5870 */ … … 155 164 * @param bValue Second value, in meters, used to translate unit according to above formula. 156 165 * @param bName Second unit used to format text. 157 */ 158 public SystemOfMeasurement(double aValue, String aName, double bValue, String bName) { 159 this(aValue, aName, bValue, bName, -1, null); 166 * @param speedName the most common speed symbol (kmh/h, mph, kn, etc.) 167 * @param speedValue the speed value for the most common speed symbol, for 1 meter per second 168 * @since 10175 169 */ 170 public SystemOfMeasurement(double aValue, String aName, double bValue, String bName, String speedName, double speedValue) { 171 this(aValue, aName, bValue, bName, speedName, speedValue, -1, null); 160 172 } 161 173 … … 170 182 * @param bValue Second value, in meters, used to translate unit according to above formula. 171 183 * @param bName Second unit used to format text. 184 * @param speedName the most common speed symbol (kmh/h, mph, kn, etc.) 185 * @param speedValue the speed value for the most common speed symbol, for 1 meter per second 172 186 * @param areaCustomValue Specific optional area value, in squared meters, between {@code aValue*aValue} and {@code bValue*bValue}. 173 187 * Set to {@code -1} if not used. 174 188 * @param areaCustomName Specific optional area unit. Set to {@code null} if not used. 175 189 * 176 * @since 5870 177 */ 178 public SystemOfMeasurement(double aValue, String aName, double bValue, String bName, double areaCustomValue, String areaCustomName) { 190 * @since 10175 191 */ 192 public SystemOfMeasurement(double aValue, String aName, double bValue, String bName, String speedName, double speedValue, 193 double areaCustomValue, String areaCustomName) { 179 194 this.aValue = aValue; 180 195 this.aName = aName; 181 196 this.bValue = bValue; 182 197 this.bName = bName; 198 this.speedValue = speedValue; 199 this.speedName = speedName; 183 200 this.areaCustomValue = areaCustomValue; 184 201 this.areaCustomName = areaCustomName;
Note:
See TracChangeset
for help on using the changeset viewer.
