1 9 package org.jscience.physics.models; 10 11 import javax.measure.converters.RationalConverter; 12 import javax.measure.converters.UnitConverter; 13 import javax.measure.units.BaseUnit; 14 import javax.measure.units.Dimension; 15 import javax.measure.units.SI; 16 17 25 public class NaturalModel extends PhysicalModel { 26 27 30 final static NaturalModel INSTANCE = new NaturalModel(); 31 32 35 private static RationalConverter METER_TO_TIME 36 = new RationalConverter(1, 299792458); 37 38 41 public static void select() { 42 throw new UnsupportedOperationException ("Not implemented"); 43 } 44 45 public Dimension getDimension(BaseUnit unit) { 47 if (unit.equals(SI.METER)) return Dimension.TIME; 48 return Dimension.Model.STANDARD.getDimension(unit); 49 } 50 51 public UnitConverter getTransform(BaseUnit unit) { 53 if (unit.equals(SI.METER)) return METER_TO_TIME; 54 return Dimension.Model.STANDARD.getTransform(unit); 55 } 56 } 74 | Popular Tags |