KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jscience > physics > models > HighEnergyModel


1 /*
2  * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences.
3  * Copyright (C) 2006 - JScience (http://jscience.org/)
4  * All rights reserved.
5  *
6  * Permission to use, copy, modify, and distribute this software is
7  * freely granted, provided that this notice is preserved.
8  */

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 /**
18  * This class represents the high-energy model.
19  *
20  * @author <a HREF="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
21  * @version 3.0, February 13, 2006
22  */

23 public class HighEnergyModel extends PhysicalModel {
24
25     /**
26      * Holds the single instance of this class.
27      */

28     final static HighEnergyModel INSTANCE = new HighEnergyModel();
29
30     /**
31      * Holds the meter to time transform.
32      */

33     private static RationalConverter METER_TO_TIME
34         = new RationalConverter(1, 299792458);
35     
36     /**
37      * Selects the relativistic model as the current model.
38      */

39     public static void select() {
40         throw new UnsupportedOperationException JavaDoc("Not implemented");
41     }
42
43     // Implements Dimension.Model
44
public Dimension getDimension(BaseUnit unit) {
45         if (unit.equals(SI.METER)) return Dimension.TIME;
46         return Dimension.Model.STANDARD.getDimension(unit);
47     }
48
49     // Implements Dimension.Model
50
public UnitConverter getTransform(BaseUnit unit) {
51         if (unit.equals(SI.METER)) return METER_TO_TIME;
52         return Dimension.Model.STANDARD.getTransform(unit);
53     }
54     
55 // // SPEED_OF_LIGHT (METER / SECOND) = 1
56
// SI.SECOND.setDimension(SI.NANO(SI.SECOND), new MultiplyConverter(1E9));
57
// SI.METER.setDimension(SI.NANO(SI.SECOND),
58
// new MultiplyConverter(1E9 / c));
59
//
60
// // ENERGY = m²·kg/s² = kg·c²
61
// SI.KILOGRAM.setDimension(SI.GIGA(NonSI.ELECTRON_VOLT),
62
// new MultiplyConverter(c * c / ePlus / 1E9));
63
//
64
// // BOLTZMANN (JOULE / KELVIN = (KILOGRAM / C^2 ) / KELVIN) = 1
65
// SI.KELVIN.setDimension(SI.GIGA(NonSI.ELECTRON_VOLT),
66
// new MultiplyConverter(k / ePlus / 1E9));
67
//
68
// // ELEMENTARY_CHARGE (SECOND * AMPERE) = 1
69
// SI.AMPERE.setDimension(Unit.ONE.divide(SI.NANO(SI.SECOND)),
70
// new MultiplyConverter(1E-9 / ePlus));
71
//
72
// SI.MOLE.setDimension(SI.MOLE, Converter.IDENTITY);
73
// SI.CANDELA.setDimension(SI.CANDELA, Converter.IDENTITY);
74
}
Popular Tags