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 23 public class RelativisticModel extends PhysicalModel { 24 25 26 29 private static RationalConverter METER_TO_TIME 30 = new RationalConverter(1, 299792458); 31 32 35 private final static RelativisticModel INSTANCE = new RelativisticModel(); 36 37 40 public static void select() { 41 PhysicalModel.setCurrent(INSTANCE); 42 } 43 44 public Dimension getDimension(BaseUnit unit) { 46 if (unit.equals(SI.METER)) return Dimension.TIME; 47 return Dimension.Model.STANDARD.getDimension(unit); 48 } 49 50 public UnitConverter getTransform(BaseUnit unit) { 52 if (unit.equals(SI.METER)) return METER_TO_TIME; 53 return Dimension.Model.STANDARD.getTransform(unit); 54 } 55 } | Popular Tags |