KickJava   Java API By Example, From Geeks To Geeks.

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


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 natural model.
19  *
20  * @author <a HREF="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
21  * @version 3.0, February 13, 2006
22  * @see <a HREF="http://en.wikipedia.org/wiki/Planck_units">
23  * Wikipedia: Planck units</a>
24  */

25 public class NaturalModel extends PhysicalModel {
26
27     /**
28      * Holds the single instance of this class.
29      */

30     final static NaturalModel INSTANCE = new NaturalModel();
31     
32     /**
33      * Holds the meter to time transform.
34      */

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

41     public static void select() {
42         throw new UnsupportedOperationException JavaDoc("Not implemented");
43     }
44
45     // Implements Dimension.Model
46
public Dimension getDimension(BaseUnit unit) {
47         if (unit.equals(SI.METER)) return Dimension.TIME;
48         return Dimension.Model.STANDARD.getDimension(unit);
49     }
50
51     // Implements Dimension.Model
52
public UnitConverter getTransform(BaseUnit unit) {
53         if (unit.equals(SI.METER)) return METER_TO_TIME;
54         return Dimension.Model.STANDARD.getTransform(unit);
55     }
56 // // H_BAR (SECOND * JOULE = SECOND * (KILOGRAM / C^2 )) = 1
57
// // SPEED_OF_LIGHT (METER / SECOND) = 1
58
// // BOLTZMANN (JOULE / KELVIN = (KILOGRAM / C^2 ) / KELVIN) = 1
59
// // MAGNETIC CONSTANT (NEWTON / AMPERE^2) = 1
60
// // GRAVITATIONAL CONSTANT (METER^3 / KILOGRAM / SECOND^2) = 1
61
// SI.SECOND.setDimension(NONE, new MultiplyConverter((c * c)
62
// * MathLib.sqrt(c / (hBar * G))));
63
// SI.METER.setDimension(NONE, new MultiplyConverter(c
64
// * MathLib.sqrt(c / (hBar * G))));
65
// SI.KILOGRAM.setDimension(NONE, new MultiplyConverter(MathLib.sqrt(G
66
// / (hBar * c))));
67
// SI.KELVIN.setDimension(NONE, new MultiplyConverter(k
68
// * MathLib.sqrt(G / (hBar * c)) / (c * c)));
69
// SI.AMPERE.setDimension(NONE, new MultiplyConverter(MathLib.sqrt(ยต0 * G)
70
// / (c * c)));
71
// SI.MOLE.setDimension(AMOUNT_OF_SUBSTANCE, Converter.IDENTITY);
72
// SI.CANDELA.setDimension(LUMINOUS_INTENSITY, Converter.IDENTITY);
73
}
74
Popular Tags