1 9 package org.jscience.physics.quantities; 10 11 import org.jscience.physics.units.SI; 12 import org.jscience.physics.units.Unit; 13 14 22 public class Length extends Quantity { 23 24 27 private final static Unit<Length> UNIT = SI.METER; 28 29 32 private final static Factory<Length> FACTORY = new Factory<Length>(UNIT) { 33 protected Length create() { 34 return new Length(); 35 } 36 }; 37 38 41 public final static Length ZERO = Quantity.valueOf(0, UNIT); 42 43 46 protected Length() { 47 } 48 49 54 public static void showAs(Unit unit) { 55 QuantityFormat.show(Length.class, unit); 56 } 57 58 62 69 public static Length valueOf(Length radius, Angle theta) { 70 return theta.times(radius).to(UNIT); 71 } 72 73 private static final long serialVersionUID = 1L; 74 } 75 | Popular Tags |