projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bump java library versions
[fw/altos]
/
altoslib
/
AltosSpeed.java
diff --git
a/altoslib/AltosSpeed.java
b/altoslib/AltosSpeed.java
index 4e2daf5ad05f9e4553641a4c117c3c31c7b648d4..738519792bf79aa4f88fa1dc18e22f989cb49f2e 100644
(file)
--- a/
altoslib/AltosSpeed.java
+++ b/
altoslib/AltosSpeed.java
@@
-15,29
+15,35
@@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.
AltosLib
;
+package org.altusmetrum.
altoslib_11
;
public class AltosSpeed extends AltosUnits {
public class AltosSpeed extends AltosUnits {
- public double value(double v) {
- if (
AltosConvert.
imperial_units)
- return AltosConvert.m
eters_to_mph
(v);
+ public double value(double v
, boolean imperial_units
) {
+ if (imperial_units)
+ return AltosConvert.m
ps_to_fps
(v);
return v;
}
return v;
}
- public String show_units() {
- if (AltosConvert.imperial_units)
- return "mph";
+ public double inverse(double v, boolean imperial_units) {
+ if (imperial_units)
+ return AltosConvert.fps_to_mps(v);
+ return v;
+ }
+
+ public String show_units(boolean imperial_units) {
+ if (imperial_units)
+ return "fps";
return "m/s";
}
return "m/s";
}
- public String say_units() {
- if (
AltosConvert.
imperial_units)
- return "
miles per hour
";
+ public String say_units(
boolean imperial_units
) {
+ if (imperial_units)
+ return "
feet per second
";
return "meters per second";
}
return "meters per second";
}
-
int show_fraction(int width
) {
+
public int show_fraction(int width, boolean imperial_units
) {
return width / 9;
}
return width / 9;
}
-}
\ No newline at end of file
+}