001/*
002 * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences.
003 * Copyright (C) 2006 - JScience (http://jscience.org/)
004 * All rights reserved.
005 * 
006 * Permission to use, copy, modify, and distribute this software is
007 * freely granted, provided that this notice is preserved.
008 */
009package org.jscience.physics.model;
010
011import javax.measure.converter.RationalConverter;
012import javax.measure.converter.UnitConverter;
013import javax.measure.unit.BaseUnit;
014import javax.measure.unit.Dimension;
015import javax.measure.unit.SI;
016
017/**
018 * This class represents the natural model.
019 *
020 * @author  <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
021 * @version 3.0, February 13, 2006
022 * @see <a href="http://en.wikipedia.org/wiki/Planck_units">
023 *      Wikipedia: Planck units</a>
024 */
025public  class NaturalModel extends PhysicalModel {
026
027        /**
028         * Holds the single instance of this class.
029         */
030        final static NaturalModel INSTANCE = new NaturalModel();
031    
032    /**
033     * Holds the meter to time transform.
034     */
035    private static RationalConverter METRE_TO_TIME 
036        = new RationalConverter(1, 299792458);
037    
038    /**
039     * Selects the relativistic model as the current model.
040     */
041    public static void select() {
042        throw new UnsupportedOperationException("Not implemented");
043    }
044
045    // Implements Dimension.Model
046    public Dimension getDimension(BaseUnit<?> unit) {
047        if (unit.equals(SI.METRE)) return Dimension.TIME;
048        return Dimension.Model.STANDARD.getDimension(unit);
049    }
050
051    // Implements Dimension.Model
052    public UnitConverter getTransform(BaseUnit<?> unit) {
053        if (unit.equals(SI.METRE)) return METRE_TO_TIME;
054        return Dimension.Model.STANDARD.getTransform(unit);
055    }
056//              // H_BAR (SECOND * JOULE = SECOND * (KILOGRAM / C^2 )) = 1
057//              // SPEED_OF_LIGHT (METRE / SECOND) = 1
058//              // BOLTZMANN (JOULE / KELVIN = (KILOGRAM / C^2 ) / KELVIN) = 1
059//              // MAGNETIC CONSTANT (NEWTON / AMPERE^2) = 1
060//              // GRAVITATIONAL CONSTANT (METRE^3 / KILOGRAM / SECOND^2) = 1
061//              SI.SECOND.setDimension(NONE, new MultiplyConverter((c * c)
062//                              * MathLib.sqrt(c / (hBar * G))));
063//              SI.METRE.setDimension(NONE, new MultiplyConverter(c
064//                              * MathLib.sqrt(c / (hBar * G))));
065//              SI.KILOGRAM.setDimension(NONE, new MultiplyConverter(MathLib.sqrt(G
066//                              / (hBar * c))));
067//              SI.KELVIN.setDimension(NONE, new MultiplyConverter(k
068//                              * MathLib.sqrt(G / (hBar * c)) / (c * c)));
069//              SI.AMPERE.setDimension(NONE, new MultiplyConverter(MathLib.sqrt(ยต0 * G)
070//                              / (c * c)));
071//              SI.MOLE.setDimension(AMOUNT_OF_SUBSTANCE, Converter.IDENTITY);
072//              SI.CANDELA.setDimension(LUMINOUS_INTENSITY, Converter.IDENTITY);
073}