KickJava   Java API By Example, From Geeks To Geeks.

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


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 quantum 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 final class QuantumModel extends PhysicalModel {
24
25     /**
26      * Holds the single instance of this class.
27      */

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

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

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

77 }
78
Popular Tags