notify-dpml AT lists.ibiblio.org
Subject: DPML Notify
List archive
svn commit: r1445 - in development/laboratory/planet/metric: . src src/main src/main/net src/main/net/dpml src/main/net/dpml/metric src/main/net/dpml/metric/acceleration src/main/net/dpml/metric/area src/main/net/dpml/metric/current src/main/net/dpml/metric/density src/main/net/dpml/metric/distance src/main/net/dpml/metric/energy src/main/net/dpml/metric/flow src/main/net/dpml/metric/force src/main/net/dpml/metric/gravity src/main/net/dpml/metric/mass src/main/net/dpml/metric/power src/main/net/dpml/metric/power/sub src/main/net/dpml/metric/pressure src/main/net/dpml/metric/ratio src/main/net/dpml/metric/resistance src/main/net/dpml/metric/temperature src/main/net/dpml/metric/time src/main/net/dpml/metric/velocity src/main/net/dpml/metric/voltage src/main/net/dpml/metric/volume
- From: niclas AT netcompartner.com
- To: notify-dpml AT lists.ibiblio.org
- Subject: svn commit: r1445 - in development/laboratory/planet/metric: . src src/main src/main/net src/main/net/dpml src/main/net/dpml/metric src/main/net/dpml/metric/acceleration src/main/net/dpml/metric/area src/main/net/dpml/metric/current src/main/net/dpml/metric/density src/main/net/dpml/metric/distance src/main/net/dpml/metric/energy src/main/net/dpml/metric/flow src/main/net/dpml/metric/force src/main/net/dpml/metric/gravity src/main/net/dpml/metric/mass src/main/net/dpml/metric/power src/main/net/dpml/metric/power/sub src/main/net/dpml/metric/pressure src/main/net/dpml/metric/ratio src/main/net/dpml/metric/resistance src/main/net/dpml/metric/temperature src/main/net/dpml/metric/time src/main/net/dpml/metric/velocity src/main/net/dpml/metric/voltage src/main/net/dpml/metric/volume
- Date: Mon, 10 Jan 2005 18:36:33 +0100
Author: niclas
Date: Mon Jan 10 18:36:32 2005
New Revision: 1445
Added:
development/laboratory/planet/metric/
development/laboratory/planet/metric/src/
development/laboratory/planet/metric/src/main/
development/laboratory/planet/metric/src/main/net/
development/laboratory/planet/metric/src/main/net/dpml/
development/laboratory/planet/metric/src/main/net/dpml/metric/
development/laboratory/planet/metric/src/main/net/dpml/metric/Acceleration.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Area.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Current.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Density.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Distance.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Energy.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Flow.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Force.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/GenericMetric.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Gravity.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Mass.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Metric.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Power.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Pressure.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Ratio.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Resistance.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Temperature.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Time.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Velocity.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Voltage.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/Volume.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/acceleration/
development/laboratory/planet/metric/src/main/net/dpml/metric/acceleration/AbstractAcceleration.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/acceleration/Acceleration_m_s2.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/area/
development/laboratory/planet/metric/src/main/net/dpml/metric/area/AbstractArea.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_cm2.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_dm2.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_km2.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_m2.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_mm2.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/current/
development/laboratory/planet/metric/src/main/net/dpml/metric/current/AbstractCurrent.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_A.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_mA.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_nA.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_pA.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_uA.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/density/
development/laboratory/planet/metric/src/main/net/dpml/metric/density/AbstractDensity.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/density/Density_g_cm3.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/AbstractDistance.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_cm.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_dm.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_km.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_m.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_mm.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/AbstractEnergy.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_GJ.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_GWh.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_J.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_MJ.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_MWh.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_Nm.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_TJ.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_TWh.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_Ws.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_kJ.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_kWh.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/AbstractFlow.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_l_h.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_l_m.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_l_s.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_m3_h.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_m3_m.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_m3_s.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/force/
development/laboratory/planet/metric/src/main/net/dpml/metric/force/AbstractForce.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/force/Force_N.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/gravity/
development/laboratory/planet/metric/src/main/net/dpml/metric/gravity/AbstractGravity.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/gravity/Gravity_m_s2.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/AbstractMass.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/Mass_g.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/Mass_kg.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/Mass_mg.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/
development/laboratory/planet/metric/src/main/net/dpml/metric/power/AbstractPower.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_GW.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_GWh_y.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_J_s.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_MW.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_MWh_y.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_Nm_s.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_TW.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_TWh_y.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_W.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_kW.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_kWh_y.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/power/sub/
development/laboratory/planet/metric/src/main/net/dpml/metric/power/sub/Power_mW.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/AbstractPressure.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_MPa.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_Pa.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_bar.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_kPa.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_mbar.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/ratio/
development/laboratory/planet/metric/src/main/net/dpml/metric/ratio/AbstractRatio.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/ratio/Ratio_abs.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/ratio/Ratio_pc.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/AbstractResistance.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/Resistance_Mohm.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/Resistance_kohm.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/Resistance_ohm.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/AbstractTemperature.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/Temperature_C.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/Temperature_F.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/Temperature_K.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/
development/laboratory/planet/metric/src/main/net/dpml/metric/time/AbstractTime.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_d.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_h.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_m.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_ms.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_ns.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_ps.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_s.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_us.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_w.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_y.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/velocity/
development/laboratory/planet/metric/src/main/net/dpml/metric/velocity/AbstractVelocity.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/velocity/Velocity_km_h.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/velocity/Velocity_m_s.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/AbstractVoltage.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_V.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_kV.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_mV.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_uV.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/AbstractVolume.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_cl.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_cm3.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_dl.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_dm3.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_km3.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_l.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_m3.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_ml.java
(contents, props changed)
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_mm3.java
(contents, props changed)
Log:
Added the Metric library, to be Metrofied in some form.
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Acceleration.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/Acceleration.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,39 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Acceleration extends Metric
+{
+ final String m_MetricName = "acceleration";
+ final String m_MetricAbbrev = "a";
+ final String[] m_MetricFormulas = { };
+
+ Acceleration add( Acceleration acceleration );
+ Acceleration subtract( Acceleration acceleration );
+ Ratio divide( Acceleration acceleration );
+ Acceleration divide( Ratio ratio );
+ Acceleration multiply( Ratio ratio );
+
+ Force multiply( Mass mass );
+
+ Acceleration to_m_s2();
+}
Added: development/laboratory/planet/metric/src/main/net/dpml/metric/Area.java
==============================================================================
--- (empty file)
+++ development/laboratory/planet/metric/src/main/net/dpml/metric/Area.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,45 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Area extends Metric
+{
+ final String m_MetricName = "area";
+ final String m_MetricAbbrev = "A";
+ final String[] m_MetricFormulas = {};
+
+ Area add( Area value );
+ Area subtract( Area value );
+
+ Volume multiply( Distance factor );
+ Distance divide( Distance divisor );
+
+ Ratio divide( Area area );
+ Area divide( Ratio ratio );
+ Area multiply( Ratio ratio );
+
+ Area to_m2();
+ Area to_mm2();
+ Area to_cm2();
+ Area to_dm2();
+ Area to_km2();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Current.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/Current.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,45 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Current extends Metric
+{
+ final String m_MetricName = "current";
+ final String m_MetricAbbrev = "I";
+ final String[] m_MetricFormulas = { };
+
+ Current add( Current current );
+ Current subtract( Current current );
+ Ratio divide( Current current );
+ Current divide( Ratio ratio );
+ Current multiply( Ratio ratio );
+
+ Voltage multiply( Resistance resistance );
+ Power computePower( Resistance resistance );
+ Resistance divide( Voltage voltage );
+
+ Current to_A();
+ Current to_mA();
+ Current to_uA();
+ Current to_nA();
+ Current to_pA();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Density.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/Density.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,37 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Density extends Metric
+{
+ final String m_MetricName = "density";
+ final String m_MetricAbbrev = "rho";
+ final String[] m_MetricFormulas = { };
+
+ Density add( Density density );
+ Density subtract( Density density );
+ Ratio divide( Density density );
+ Density divide( Ratio ratio );
+ Density multiply( Ratio ratio );
+
+ Density to_g_cm3();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Distance.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/Distance.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,44 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Distance extends Metric
+{
+ final String m_MetricName = "distance";
+ final String m_MetricAbbrev = "s";
+ final String[] m_MetricFormulas = { "s=v*t" };
+
+ Distance add( Distance value );
+ Distance subtract( Distance value );
+ Ratio divide( Distance distance );
+ Distance divide( Ratio ratio );
+ Distance multiply( Ratio ratio );
+
+ Area multiply( Distance factor );
+ Volume multiply( Area factor );
+
+ Distance to_m();
+ Distance to_mm();
+ Distance to_cm();
+ Distance to_dm();
+ Distance to_km();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Energy.java
==============================================================================
--- (empty file)
+++ development/laboratory/planet/metric/src/main/net/dpml/metric/Energy.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,52 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+import io.bali.metric.energy.*;
+
+public interface Energy extends Metric
+{
+ final String m_MetricName = "energy";
+ final String m_MetricAbbrev = "W";
+ final String[] m_MetricFormulas = { };
+
+ Energy add( Energy energy );
+ Energy subtract( Energy energy );
+ Ratio divide( Energy energy );
+ Energy divide( Ratio ratio );
+ Energy multiply( Ratio ratio );
+
+ Power divide( Time time );
+ Distance divide( Force force );
+
+ Energy to_J();
+ Energy to_kJ();
+ Energy to_MJ();
+ Energy to_GJ();
+ Energy to_TJ();
+ Energy to_Nm();
+ Energy to_Ws();
+ Energy to_kWh();
+ Energy to_MWh();
+ Energy to_GWh();
+ Energy to_TWh();
+}
Added: development/laboratory/planet/metric/src/main/net/dpml/metric/Flow.java
==============================================================================
--- (empty file)
+++ development/laboratory/planet/metric/src/main/net/dpml/metric/Flow.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,44 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Flow extends Metric
+{
+ final String m_MetricName = "flow";
+ final String m_MetricAbbrev = "F";
+ final String[] m_MetricFormulas = { };
+
+ Flow add( Flow flow);
+ Flow subtract( Flow flow );
+ Ratio divide( Flow flow );
+ Flow divide( Ratio ratio );
+ Flow multiply( Ratio ratio );
+
+ Volume multiply( Time time );
+
+ Flow to_l_s();
+ Flow to_l_m();
+ Flow to_l_h();
+ Flow to_m3_s();
+ Flow to_m3_m();
+ Flow to_m3_h();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Force.java
==============================================================================
--- (empty file)
+++ development/laboratory/planet/metric/src/main/net/dpml/metric/Force.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,39 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Force extends Metric
+{
+ final String m_MetricName = "force";
+ final String m_MetricAbbrev = "F";
+ final String[] m_MetricFormulas = { };
+
+ Force add( Force force );
+ Force subtract( Force force );
+ Ratio divide( Force force );
+ Force divide( Ratio ratio );
+ Force multiply( Ratio ratio );
+
+ Energy multiply( Distance distance );
+
+ Force to_N();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/GenericMetric.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/GenericMetric.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,90 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public abstract class GenericMetric extends Number
+ implements Metric
+{
+ static final long serialVersionUID = 1L;
+
+ protected final double value;
+ protected double m_Reliability = 1.0;
+
+ public GenericMetric( double val )
+ {
+ value = val;
+ }
+
+ public int intValue()
+ {
+ return (int) value;
+ }
+
+ public float floatValue()
+ {
+ return (float) value;
+ }
+
+ public double doubleValue()
+ {
+ return value;
+ }
+
+ public long longValue()
+ {
+ return (long) value;
+ }
+
+ public byte byteValue()
+ {
+ return (byte) value;
+ }
+
+ public short shortValue()
+ {
+ return (short) value;
+ }
+
+ public String toString()
+ {
+ return value + " " + getUnit();
+ }
+
+ public abstract Metric create( double newvalue );
+
+ public abstract String getUnit();
+ public abstract String getUnitName();
+ public abstract String getMetricName();
+ public abstract String[] getMetricFormulas();
+ public abstract String getMetricAbbrev();
+
+ public double getReliability()
+ {
+ return m_Reliability;
+ }
+
+ public void setReliability(double reliability)
+ {
+ m_Reliability = reliability;
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Gravity.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/Gravity.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,37 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Gravity extends Metric
+{
+ final String m_MetricName = "gravity";
+ final String m_MetricAbbrev = "g";
+ final String[] m_MetricFormulas = { };
+
+ Gravity add( Gravity gravity );
+ Gravity subtract( Gravity gravity );
+ Ratio divide( Gravity gravity );
+ Gravity divide( Ratio ratio );
+ Gravity multiply( Ratio ratio );
+
+ Gravity to_m_s2();
+}
Added: development/laboratory/planet/metric/src/main/net/dpml/metric/Mass.java
==============================================================================
--- (empty file)
+++ development/laboratory/planet/metric/src/main/net/dpml/metric/Mass.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,45 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Mass extends Metric
+{
+ final String m_MetricName = "mass";
+ final String m_MetricAbbrev = "m";
+ final String[] m_MetricFormulas = { };
+
+ Mass add( Mass mass );
+ Mass subtract( Mass mass );
+ Ratio divide( Mass mass );
+ Mass divide( Ratio ratio );
+ Mass multiply( Ratio ratio );
+
+ Density divide( Volume volume );
+ Force multiply( Acceleration acceleration );
+
+ Energy compute( Gravity gravity, Distance height );
+ Energy compute( Velocity velocity );
+
+ Mass to_kg();
+ Mass to_g();
+ Mass to_mg();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Metric.java
==============================================================================
--- (empty file)
+++ development/laboratory/planet/metric/src/main/net/dpml/metric/Metric.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,42 @@
+/*
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Metric extends java.io.Serializable
+{
+ byte byteValue();
+ short shortValue();
+ float floatValue();
+ double doubleValue();
+ int intValue();
+ long longValue();
+
+ double getReliability();
+ void setReliability(double reliability);
+
+ Metric create( double newvalue );
+
+ String getUnit();
+ String getUnitName();
+ String getMetricName();
+ String[] getMetricFormulas();
+ String getMetricAbbrev();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Power.java
==============================================================================
--- (empty file)
+++ development/laboratory/planet/metric/src/main/net/dpml/metric/Power.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,56 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Power extends Metric
+{
+ final String m_MetricName = "power";
+ final String m_MetricAbbrev = "P";
+ final String[] m_MetricFormulas = { };
+
+ Power add( Power power );
+ Power subtract( Power power );
+ Ratio divide( Power power );
+ Power divide( Ratio ratio );
+ Power multiply( Ratio ratio );
+
+ Energy multiply( Time time );
+ Voltage divide( Current current );
+ Current divide( Voltage voltage );
+ Resistance computeResistance( Voltage voltage );
+ Resistance computeResistance( Current current );
+
+ Power to_mW();
+ Power to_W();
+ Power to_kW();
+ Power to_MW();
+ Power to_GW();
+ Power to_TW();
+
+ Power to_kWh_y();
+ Power to_MWh_y();
+ Power to_GWh_y();
+ Power to_TWh_y();
+
+ Power to_Nm_s();
+ Power to_J_s();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Pressure.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/Pressure.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,43 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Pressure extends Metric
+{
+ final String m_MetricName = "pressure";
+ final String m_MetricAbbrev = "p";
+ final String[] m_MetricFormulas = { };
+
+ Pressure add( Pressure pressure );
+ Pressure subtract( Pressure pressure );
+ Ratio divide( Pressure pressure );
+ Pressure divide( Ratio ratio );
+ Pressure multiply( Ratio ratio );
+
+ Force multiply( Area area );
+
+ Pressure to_Pa();
+ Pressure to_kPa();
+ Pressure to_MPa();
+ Pressure to_bar();
+ Pressure to_mbar();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Ratio.java
==============================================================================
--- (empty file)
+++ development/laboratory/planet/metric/src/main/net/dpml/metric/Ratio.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,37 @@
+/*
+ * 0.98 99/01/12 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+import io.bali.metric.ratio.*;
+
+public interface Ratio extends Metric
+{
+ final String m_MetricName = "ratio";
+ final String m_MetricAbbrev = "ny";
+ final String[] m_MetricFormulas = {};
+
+ Ratio add( Ratio value );
+ Ratio subtract( Ratio value );
+
+ Ratio to_pc();
+ Ratio to_abs();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Resistance.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/Resistance.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,43 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Resistance extends Metric
+{
+ final String m_MetricName = "resistance";
+ final String m_MetricAbbrev = "R";
+ final String[] m_MetricFormulas = { };
+
+ Resistance add( Resistance resistance );
+ Resistance subtract( Resistance resistance );
+ Ratio divide( Resistance resistance );
+ Resistance divide( Ratio ratio );
+ Resistance multiply( Ratio ratio );
+
+ Voltage multiply( Current current );
+ Current divide( Voltage voltage );
+ Power computePower( Current current );
+
+ Resistance to_ohm();
+ Resistance to_kohm();
+ Resistance to_Mohm();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Temperature.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/Temperature.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,36 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Temperature extends Metric
+{
+ final String m_MetricName = "temperature";
+ final String m_MetricAbbrev = "T";
+ final String[] m_MetricFormulas = { };
+
+ Temperature add( Temperature temperature );
+ Temperature subtract( Temperature temperature );
+
+ Temperature to_C();
+ Temperature to_F();
+ Temperature to_K();
+}
Added: development/laboratory/planet/metric/src/main/net/dpml/metric/Time.java
==============================================================================
--- (empty file)
+++ development/laboratory/planet/metric/src/main/net/dpml/metric/Time.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,48 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Time extends Metric
+{
+ final String m_MetricName = "time";
+ final String m_MetricAbbrev = "s";
+ final String[] m_MetricFormulas = { };
+
+ Time add( Time time );
+ Time subtract( Time time );
+ Ratio divide( Time time );
+ Time divide( Ratio ratio );
+ Time multiply( Ratio ratio );
+
+ Energy multiply( Power power );
+
+ Time to_ps();
+ Time to_ns();
+ Time to_us();
+ Time to_ms();
+ Time to_s();
+ Time to_m();
+ Time to_h();
+ Time to_d();
+ Time to_w();
+ Time to_y();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Velocity.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/Velocity.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,38 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Velocity extends Metric
+{
+ final String m_MetricName = "velocity";
+ final String m_MetricAbbrev = "v";
+ final String[] m_MetricFormulas = { };
+
+ Velocity add( Velocity velocity );
+ Velocity subtract( Velocity velocity );
+ Ratio divide( Velocity velocity );
+ Velocity divide( Ratio ratio );
+ Velocity multiply( Ratio ratio );
+
+ Velocity to_m_s();
+ Velocity to_km_h();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Voltage.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/Voltage.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,44 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Voltage extends Metric
+{
+ final String m_MetricName = "voltage";
+ final String m_MetricAbbrev = "U";
+ final String[] m_MetricFormulas = { };
+
+ Voltage add( Voltage voltage );
+ Voltage subtract( Voltage voltage );
+ Ratio divide( Voltage voltage );
+ Voltage divide( Ratio ratio );
+ Voltage multiply( Ratio ratio );
+
+ Resistance divide( Current current );
+ Current divide( Resistance reistance );
+ Power multiply( Current current );
+
+ Voltage to_V();
+ Voltage to_mV();
+ Voltage to_uV();
+ Voltage to_kV();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/Volume.java
==============================================================================
--- (empty file)
+++ development/laboratory/planet/metric/src/main/net/dpml/metric/Volume.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,50 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric;
+
+public interface Volume extends Metric
+{
+ final String m_MetricName = "volume";
+ final String m_MetricAbbrev = "V";
+ final String[] m_MetricFormulas = {};
+
+ Volume add( Volume value );
+ Volume subtract( Volume value );
+
+ Area divide( Distance divisor );
+ Distance divide( Area divisor );
+ Ratio divide( Volume volume );
+ Flow divide( Time tm);
+
+ Volume divide( Ratio ratio );
+ Volume multiply( Ratio ratio );
+
+ Volume to_m3();
+ Volume to_mm3();
+ Volume to_cm3();
+ Volume to_dm3();
+ Volume to_km3();
+ Volume to_ml();
+ Volume to_cl();
+ Volume to_dl();
+ Volume to_l();
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/acceleration/AbstractAcceleration.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/acceleration/AbstractAcceleration.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,43 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.acceleration;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.force.Force_N;
+
+public abstract class AbstractAcceleration extends GenericMetric
+ implements Acceleration
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractAcceleration( double value )
+ {
+ super( value );
+ }
+
+ public Force multiply( Mass mass )
+ {
+ return new Force_N( to_m_s2().doubleValue() *
mass.to_kg().doubleValue() );
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/acceleration/Acceleration_m_s2.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/acceleration/Acceleration_m_s2.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,104 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.acceleration;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Acceleration_m_s2 extends AbstractAcceleration
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "m/s";
+ m_UnitName = "meter per square-second";
+ }
+
+ public Acceleration_m_s2(double value)
+ {
+ super(value );
+ }
+
+ public Acceleration subtract( Acceleration acceleration )
+ {
+ return new Acceleration_m_s2( this.value -
acceleration.to_m_s2().doubleValue() );
+ }
+
+ public Acceleration add( Acceleration acceleration )
+ {
+ return new Acceleration_m_s2( this.value +
acceleration.to_m_s2().doubleValue() );
+ }
+
+ public Ratio divide( Acceleration acceleration )
+ {
+ return new Ratio_abs( this.value /
acceleration.to_m_s2().doubleValue() );
+ }
+
+ public Acceleration divide( Ratio ratio )
+ {
+ return new Acceleration_m_s2( this.value /
ratio.to_abs().doubleValue() );
+ }
+
+ public Acceleration multiply( Ratio ratio )
+ {
+ return new Acceleration_m_s2( this.value *
ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Acceleration_m_s2(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Acceleration to_m_s2()
+ {
+ return new Acceleration_m_s2( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/area/AbstractArea.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/area/AbstractArea.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,38 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.area;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_cm;
+import net.dpml.metric.volume.Volume_cm3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public abstract class AbstractArea extends GenericMetric
+ implements Area
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractArea(double value)
+ {
+ super(value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_cm2.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_cm2.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,137 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.area;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_cm;
+import net.dpml.metric.volume.Volume_cm3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Area_cm2 extends AbstractArea
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "cm";
+ m_UnitName = "square-centimeter";
+ }
+
+ public Area_cm2(double value)
+ {
+ super(value );
+ }
+
+ public Distance divide( Distance distance )
+ {
+ return new Distance_cm( this.value / distance.to_cm().doubleValue()
);
+ }
+
+ public Volume multiply( Distance distance )
+ {
+ return new Volume_cm3( this.value * distance.to_cm().doubleValue() );
+ }
+
+ public Area subtract( Area area )
+ {
+ return new Area_cm2( this.value - area.to_cm2().doubleValue() );
+ }
+
+ public Area add( Area area )
+ {
+ return new Area_cm2( this.value + area.to_cm2().doubleValue() );
+ }
+
+ public Ratio divide( Area area )
+ {
+ return new Ratio_abs( this.value / area.to_cm2().doubleValue() );
+ }
+
+ public Area divide( Ratio ratio )
+ {
+ return new Area_cm2( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Area multiply( Ratio ratio )
+ {
+ return new Area_cm2( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Area_cm2(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Area to_m2()
+ {
+ return new Area_m2( value / 10000.0 );
+ }
+
+ public Area to_mm2()
+ {
+ return new Area_mm2( value * 100.0 );
+ }
+
+ public Area to_cm2()
+ {
+ return new Area_cm2( value );
+ }
+
+ public Area to_dm2()
+ {
+ return new Area_dm2( value / 100.0 );
+ }
+
+ public Area to_km2()
+ {
+ return new Area_km2( value / 10000000000.0 );
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_dm2.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_dm2.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,136 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.area;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_dm;
+import net.dpml.metric.volume.Volume_dm3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Area_dm2 extends AbstractArea
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "dm";
+ m_UnitName = "square-decimeter";
+ }
+
+ public Area_dm2(double value)
+ {
+ super(value );
+ }
+
+ public Distance divide( Distance distance )
+ {
+ return new Distance_dm( this.value / distance.to_dm().doubleValue()
);
+ }
+
+ public Volume multiply( Distance distance )
+ {
+ return new Volume_dm3( this.value * distance.to_dm().doubleValue() );
+ }
+
+ public Area subtract( Area area )
+ {
+ return new Area_dm2( this.value - area.to_dm2().doubleValue() );
+ }
+
+ public Area add( Area area )
+ {
+ return new Area_dm2( this.value + area.to_dm2().doubleValue() );
+ }
+
+ public Ratio divide( Area area )
+ {
+ return new Ratio_abs( this.value / area.to_dm2().doubleValue() );
+ }
+
+ public Area divide( Ratio ratio )
+ {
+ return new Area_dm2( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Area multiply( Ratio ratio )
+ {
+ return new Area_dm2( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Area_dm2(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Area to_m2()
+ {
+ return new Area_m2( value / 100.0 );
+ }
+
+ public Area to_mm2()
+ {
+ return new Area_mm2( value * 10000.0 );
+ }
+
+ public Area to_cm2()
+ {
+ return new Area_cm2( value * 100.0 );
+ }
+
+ public Area to_dm2()
+ {
+ return new Area_dm2( value );
+ }
+
+ public Area to_km2()
+ {
+ return new Area_km2( value / 100000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_km2.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_km2.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,136 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.area;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_km;
+import net.dpml.metric.volume.Volume_km3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Area_km2 extends AbstractArea
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "km";
+ m_UnitName = "square-kilometer";
+ }
+
+ public Area_km2(double value)
+ {
+ super(value );
+ }
+
+ public Distance divide( Distance distance )
+ {
+ return new Distance_km( this.value / distance.to_km().doubleValue()
);
+ }
+
+ public Volume multiply( Distance distance )
+ {
+ return new Volume_km3( this.value * distance.to_km().doubleValue() );
+ }
+
+ public Area subtract( Area area )
+ {
+ return new Area_km2( this.value - area.to_km2().doubleValue() );
+ }
+
+ public Area add( Area area )
+ {
+ return new Area_km2( this.value + area.to_km2().doubleValue() );
+ }
+
+ public Ratio divide( Area area )
+ {
+ return new Ratio_abs( this.value / area.to_km2().doubleValue() );
+ }
+
+ public Area divide( Ratio ratio )
+ {
+ return new Area_km2( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Area multiply( Ratio ratio )
+ {
+ return new Area_km2( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Area_km2(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Area to_m2()
+ {
+ return new Area_m2( value * 1000000.0 );
+ }
+
+ public Area to_mm2()
+ {
+ return new Area_mm2( value * 1000000000000.0 );
+ }
+
+ public Area to_cm2()
+ {
+ return new Area_cm2( value * 10000000000.0 );
+ }
+
+ public Area to_dm2()
+ {
+ return new Area_dm2( value * 100000000.0 );
+ }
+
+ public Area to_km2()
+ {
+ return new Area_km2( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_m2.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_m2.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,136 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.area;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_m;
+import net.dpml.metric.volume.Volume_m3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Area_m2 extends AbstractArea
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "m";
+ m_UnitName = "square-meter";
+ }
+
+ public Area_m2(double value)
+ {
+ super(value );
+ }
+
+ public Distance divide( Distance distance )
+ {
+ return new Distance_m( this.value / distance.to_m().doubleValue() );
+ }
+
+ public Volume multiply( Distance distance )
+ {
+ return new Volume_m3( this.value * distance.to_m().doubleValue() );
+ }
+
+ public Area subtract( Area area )
+ {
+ return new Area_m2( this.value - area.to_m2().doubleValue() );
+ }
+
+ public Area add( Area area )
+ {
+ return new Area_m2( this.value + area.to_m2().doubleValue() );
+ }
+
+ public Ratio divide( Area area )
+ {
+ return new Ratio_abs( this.value / area.to_m2().doubleValue() );
+ }
+
+ public Area divide( Ratio ratio )
+ {
+ return new Area_m2( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Area multiply( Ratio ratio )
+ {
+ return new Area_m2( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Area_m2(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Area to_m2()
+ {
+ return new Area_m2( value );
+ }
+
+ public Area to_mm2()
+ {
+ return new Area_mm2( value * 1000000.0 );
+ }
+
+ public Area to_cm2()
+ {
+ return new Area_cm2( value * 10000.0 );
+ }
+
+ public Area to_dm2()
+ {
+ return new Area_dm2( value * 100.0 );
+ }
+
+ public Area to_km2()
+ {
+ return new Area_km2( value / 1000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_mm2.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/area/Area_mm2.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,136 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.area;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_mm;
+import net.dpml.metric.volume.Volume_mm3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Area_mm2 extends AbstractArea
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "mm";
+ m_UnitName = "square-millimeter";
+ }
+
+ public Area_mm2(double value)
+ {
+ super(value );
+ }
+
+ public Distance divide( Distance distance )
+ {
+ return new Distance_mm( this.value / distance.to_mm().doubleValue()
);
+ }
+
+ public Volume multiply( Distance distance )
+ {
+ return new Volume_mm3( this.value * distance.to_mm().doubleValue() );
+ }
+
+ public Area subtract( Area area )
+ {
+ return new Area_mm2( this.value - area.to_mm2().doubleValue() );
+ }
+
+ public Area add( Area area )
+ {
+ return new Area_mm2( this.value + area.to_mm2().doubleValue() );
+ }
+
+ public Ratio divide( Area area )
+ {
+ return new Ratio_abs( this.value / area.to_mm2().doubleValue() );
+ }
+
+ public Area divide( Ratio ratio )
+ {
+ return new Area_mm2( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Area multiply( Ratio ratio )
+ {
+ return new Area_mm2( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Area_m2(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Area to_m2()
+ {
+ return new Area_m2( value / 1000000.0 );
+ }
+
+ public Area to_mm2()
+ {
+ return new Area_mm2( value );
+ }
+
+ public Area to_cm2()
+ {
+ return new Area_cm2( value / 100.0 );
+ }
+
+ public Area to_dm2()
+ {
+ return new Area_dm2( value / 10000.0 );
+ }
+
+ public Area to_km2()
+ {
+ return new Area_km2( value / 1000000000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/current/AbstractCurrent.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/current/AbstractCurrent.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,35 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.current;
+
+import net.dpml.metric.*;
+
+public abstract class AbstractCurrent extends GenericMetric
+ implements Current
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractCurrent( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_A.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_A.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,142 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.current;
+
+import net.dpml.metric.*;
+import net.dpml.metric.resistance.Resistance_ohm;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+
+public final class Current_A extends AbstractCurrent
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "A" );
+ m_UnitName = ( "ampere" );
+ }
+
+ public Current_A( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Current_A(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Current add( Current current)
+ {
+ return new Current_A( value + current.to_A().doubleValue() );
+ }
+
+ public Current subtract( Current current )
+ {
+ return new Current_A( value - current.to_A().doubleValue() );
+ }
+
+ public Ratio divide( Current current )
+ {
+ return new Ratio_abs( value / current.to_A().doubleValue() );
+ }
+
+ public Current divide( Ratio ratio )
+ {
+ return new Current_A( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Current multiply( Ratio ratio )
+ {
+ return new Current_A( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance divide( Voltage voltage )
+ {
+ return new Resistance_ohm( voltage.to_V().doubleValue() / value );
+ }
+
+ public Voltage multiply( Resistance resistance )
+ {
+ return new Voltage_V( value * resistance.to_ohm().doubleValue() );
+ }
+
+ public Power computePower( Resistance resistance )
+ {
+ return new Power_W( value * value * resistance.to_ohm().doubleValue()
);
+ }
+
+ public Current to_A()
+ {
+ return new Current_A( value );
+ }
+
+ public Current to_mA()
+ {
+ return new Current_mA( value * 1000.0 );
+ }
+
+ public Current to_uA()
+ {
+ return new Current_uA( value * 1000000.0 );
+ }
+
+ public Current to_nA()
+ {
+ return new Current_nA( value * 1000000000.0 );
+ }
+
+ public Current to_pA()
+ {
+ return new Current_pA( value * 1000000000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_mA.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_mA.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,143 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.current;
+
+import net.dpml.metric.*;
+import net.dpml.metric.resistance.Resistance_ohm;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+
+public final class Current_mA extends AbstractCurrent
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "mA" );
+ m_UnitName = ( "milliampere" );
+ }
+
+ public Current_mA( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Current_mA(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Current add( Current current)
+ {
+ return new Current_mA( value + current.to_mA().doubleValue() );
+ }
+
+ public Current subtract( Current current )
+ {
+ return new Current_mA( value - current.to_mA().doubleValue() );
+ }
+
+ public Ratio divide( Current current )
+ {
+ return new Ratio_abs( value / current.to_mA().doubleValue() );
+ }
+
+ public Current divide( Ratio ratio )
+ {
+ return new Current_mA( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Current multiply( Ratio ratio )
+ {
+ return new Current_mA( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance divide( Voltage voltage )
+ {
+ return new Resistance_ohm( voltage.to_V().doubleValue() /
to_A().doubleValue() );
+ }
+
+ public Voltage multiply( Resistance resistance )
+ {
+ return new Voltage_V( to_A().doubleValue() *
resistance.to_ohm().doubleValue() );
+ }
+
+ public Power computePower( Resistance resistance )
+ {
+ double amp = to_A().doubleValue();
+ return new Power_W( amp * amp * resistance.to_ohm().doubleValue() );
+ }
+
+ public Current to_A()
+ {
+ return new Current_A( value / 1000.0);
+ }
+
+ public Current to_mA()
+ {
+ return new Current_mA( value );
+ }
+
+ public Current to_uA()
+ {
+ return new Current_uA( value * 1000.0 );
+ }
+
+ public Current to_nA()
+ {
+ return new Current_nA( value * 1000000.0 );
+ }
+
+ public Current to_pA()
+ {
+ return new Current_pA( value * 1000000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_nA.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_nA.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,143 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.current;
+
+import net.dpml.metric.*;
+import net.dpml.metric.resistance.Resistance_ohm;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+
+public final class Current_nA extends AbstractCurrent
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "nA" );
+ m_UnitName = ( "nanoampere" );
+ }
+
+ public Current_nA( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Current_nA(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Current add( Current current)
+ {
+ return new Current_nA( value + current.to_nA().doubleValue() );
+ }
+
+ public Current subtract( Current current )
+ {
+ return new Current_nA( value - current.to_nA().doubleValue() );
+ }
+
+ public Ratio divide( Current current )
+ {
+ return new Ratio_abs( value / current.to_nA().doubleValue() );
+ }
+
+ public Current divide( Ratio ratio )
+ {
+ return new Current_nA( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Current multiply( Ratio ratio )
+ {
+ return new Current_nA( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance divide( Voltage voltage )
+ {
+ return new Resistance_ohm( voltage.to_V().doubleValue() /
to_A().doubleValue() );
+ }
+
+ public Voltage multiply( Resistance resistance )
+ {
+ return new Voltage_V( to_A().doubleValue() *
resistance.to_ohm().doubleValue() );
+ }
+
+ public Power computePower( Resistance resistance )
+ {
+ double amp = to_A().doubleValue();
+ return new Power_W( amp * amp * resistance.to_ohm().doubleValue() );
+ }
+
+ public Current to_A()
+ {
+ return new Current_A( value / 1000000000.0);
+ }
+
+ public Current to_mA()
+ {
+ return new Current_mA( value / 1000000.0 );
+ }
+
+ public Current to_uA()
+ {
+ return new Current_uA( value / 1000.0 );
+ }
+
+ public Current to_nA()
+ {
+ return new Current_nA( value );
+ }
+
+ public Current to_pA()
+ {
+ return new Current_pA( value * 1000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_pA.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_pA.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,143 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.current;
+
+import net.dpml.metric.*;
+import net.dpml.metric.resistance.Resistance_ohm;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+
+public final class Current_pA extends AbstractCurrent
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "pA" );
+ m_UnitName = ( "picoampere" );
+ }
+
+ public Current_pA( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Current_pA(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Current add( Current current)
+ {
+ return new Current_pA( value + current.to_pA().doubleValue() );
+ }
+
+ public Current subtract( Current current )
+ {
+ return new Current_pA( value - current.to_pA().doubleValue() );
+ }
+
+ public Ratio divide( Current current )
+ {
+ return new Ratio_abs( value / current.to_pA().doubleValue() );
+ }
+
+ public Current divide( Ratio ratio )
+ {
+ return new Current_pA( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Current multiply( Ratio ratio )
+ {
+ return new Current_pA( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance divide( Voltage voltage )
+ {
+ return new Resistance_ohm( voltage.to_V().doubleValue() /
to_A().doubleValue() );
+ }
+
+ public Voltage multiply( Resistance resistance )
+ {
+ return new Voltage_V( to_A().doubleValue() *
resistance.to_ohm().doubleValue() );
+ }
+
+ public Power computePower( Resistance resistance )
+ {
+ double amp = to_A().doubleValue();
+ return new Power_W( amp * amp * resistance.to_ohm().doubleValue() );
+ }
+
+ public Current to_A()
+ {
+ return new Current_A( value / 1000000000000.0);
+ }
+
+ public Current to_mA()
+ {
+ return new Current_mA( value / 1000000000.0 );
+ }
+
+ public Current to_uA()
+ {
+ return new Current_uA( value / 1000000.0 );
+ }
+
+ public Current to_nA()
+ {
+ return new Current_nA( value / 1000.0 );
+ }
+
+ public Current to_pA()
+ {
+ return new Current_pA( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_uA.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/current/Current_uA.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,143 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.current;
+
+import net.dpml.metric.*;
+import net.dpml.metric.resistance.Resistance_ohm;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+
+public final class Current_uA extends AbstractCurrent
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "A" );
+ m_UnitName = ( "microampere" );
+ }
+
+ public Current_uA( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Current_uA(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Current add( Current current)
+ {
+ return new Current_uA( value + current.to_uA().doubleValue() );
+ }
+
+ public Current subtract( Current current )
+ {
+ return new Current_uA( value - current.to_uA().doubleValue() );
+ }
+
+ public Ratio divide( Current current )
+ {
+ return new Ratio_abs( value / current.to_uA().doubleValue() );
+ }
+
+ public Current divide( Ratio ratio )
+ {
+ return new Current_uA( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Current multiply( Ratio ratio )
+ {
+ return new Current_uA( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance divide( Voltage voltage )
+ {
+ return new Resistance_ohm( voltage.to_V().doubleValue() /
to_A().doubleValue() );
+ }
+
+ public Voltage multiply( Resistance resistance )
+ {
+ return new Voltage_V( to_A().doubleValue() *
resistance.to_ohm().doubleValue() );
+ }
+
+ public Power computePower( Resistance resistance )
+ {
+ double amp = to_A().doubleValue();
+ return new Power_W( amp * amp * resistance.to_ohm().doubleValue() );
+ }
+
+ public Current to_A()
+ {
+ return new Current_A( value / 1000000.0);
+ }
+
+ public Current to_mA()
+ {
+ return new Current_mA( value / 1000.0 );
+ }
+
+ public Current to_uA()
+ {
+ return new Current_uA( value );
+ }
+
+ public Current to_nA()
+ {
+ return new Current_nA( value * 1000.0 );
+ }
+
+ public Current to_pA()
+ {
+ return new Current_pA( value * 1000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/density/AbstractDensity.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/density/AbstractDensity.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,36 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.density;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public abstract class AbstractDensity extends GenericMetric
+ implements Density
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractDensity( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/density/Density_g_cm3.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/density/Density_g_cm3.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,104 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.density;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Density_g_cm3 extends AbstractDensity
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "g/cm";
+ m_UnitName = "gram per cubic-centimeter";
+ }
+
+ public Density_g_cm3(double value)
+ {
+ super(value );
+ }
+
+ public Density subtract( Density density )
+ {
+ return new Density_g_cm3( this.value -
density.to_g_cm3().doubleValue() );
+ }
+
+ public Density add( Density density )
+ {
+ return new Density_g_cm3( this.value +
density.to_g_cm3().doubleValue() );
+ }
+
+ public Ratio divide( Density density )
+ {
+ return new Ratio_abs( this.value / density.to_g_cm3().doubleValue()
);
+ }
+
+ public Density divide( Ratio ratio )
+ {
+ return new Density_g_cm3( this.value / ratio.to_abs().doubleValue()
);
+ }
+
+ public Density multiply( Ratio ratio )
+ {
+ return new Density_g_cm3( this.value * ratio.to_abs().doubleValue()
);
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Density_g_cm3(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Density to_g_cm3()
+ {
+ return new Density_g_cm3( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/AbstractDistance.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/AbstractDistance.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,35 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.distance;
+
+import net.dpml.metric.*;
+
+public abstract class AbstractDistance extends GenericMetric
+ implements Distance
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractDistance( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_cm.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_cm.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,136 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.distance;
+
+import net.dpml.metric.*;
+import net.dpml.metric.area.Area_cm2;
+import net.dpml.metric.volume.Volume_cm3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Distance_cm extends AbstractDistance
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "cm" );
+ m_UnitName = ( "centimeter" );
+ }
+
+ public Distance_cm( double value )
+ {
+ super( value );
+ }
+
+ public Area multiply( Distance distance )
+ {
+ return new Area_cm2( value * distance.to_cm().doubleValue() );
+ }
+
+ public Volume multiply( Area area )
+ {
+ return new Volume_cm3( value * area.to_cm2().doubleValue() );
+ }
+
+ public Distance add( Distance distance )
+ {
+ return new Distance_cm( value + distance.to_cm().doubleValue() );
+ }
+
+ public Distance subtract( Distance distance )
+ {
+ return new Distance_cm( value - distance.to_cm().doubleValue() );
+ }
+
+ public Ratio divide( Distance distance )
+ {
+ return new Ratio_abs( this.value / distance.to_cm().doubleValue() );
+ }
+
+ public Distance divide( Ratio ratio )
+ {
+ return new Distance_cm( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Distance multiply( Ratio ratio )
+ {
+ return new Distance_cm( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Distance_cm(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Distance to_m()
+ {
+ return new Distance_m( value / 100 );
+ }
+
+ public Distance to_mm()
+ {
+ return new Distance_mm( value * 10 );
+ }
+
+ public Distance to_cm()
+ {
+ return new Distance_cm( value );
+ }
+
+ public Distance to_dm()
+ {
+ return new Distance_dm( value / 10 );
+ }
+
+ public Distance to_km()
+ {
+ return new Distance_km( value / 100000 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_dm.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_dm.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,136 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.distance;
+
+import net.dpml.metric.*;
+import net.dpml.metric.area.Area_dm2;
+import net.dpml.metric.volume.Volume_dm3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Distance_dm extends AbstractDistance
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "dm" );
+ m_UnitName = ( "decimeter" );
+ }
+
+ public Distance_dm( double value )
+ {
+ super( value );
+ }
+
+ public Area multiply( Distance distance )
+ {
+ return new Area_dm2( value * distance.to_dm().doubleValue() );
+ }
+
+ public Volume multiply( Area area )
+ {
+ return new Volume_dm3( value * area.to_dm2().doubleValue() );
+ }
+
+ public Distance add( Distance distance )
+ {
+ return new Distance_dm( value + distance.to_dm().doubleValue() );
+ }
+
+ public Distance subtract( Distance distance )
+ {
+ return new Distance_dm( value - distance.to_dm().doubleValue() );
+ }
+
+ public Ratio divide( Distance distance )
+ {
+ return new Ratio_abs( this.value / distance.to_dm().doubleValue() );
+ }
+
+ public Distance divide( Ratio ratio )
+ {
+ return new Distance_dm( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Distance multiply( Ratio ratio )
+ {
+ return new Distance_dm( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Distance_dm(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Distance to_m()
+ {
+ return new Distance_m( value / 10 );
+ }
+
+ public Distance to_mm()
+ {
+ return new Distance_mm( value * 100 );
+ }
+
+ public Distance to_cm()
+ {
+ return new Distance_cm( value * 10 );
+ }
+
+ public Distance to_dm()
+ {
+ return new Distance_dm( value );
+ }
+
+ public Distance to_km()
+ {
+ return new Distance_km( value / 10000 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_km.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_km.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,136 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.distance;
+
+import net.dpml.metric.*;
+import net.dpml.metric.area.Area_km2;
+import net.dpml.metric.volume.Volume_km3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Distance_km extends AbstractDistance
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "km" );
+ m_UnitName = ( "kilometer" );
+ }
+
+ public Distance_km( double value )
+ {
+ super( value );
+ }
+
+ public Area multiply( Distance distance )
+ {
+ return new Area_km2( value * distance.to_km().doubleValue() );
+ }
+
+ public Volume multiply( Area area )
+ {
+ return new Volume_km3( value * area.to_km2().doubleValue() );
+ }
+
+ public Distance add( Distance distance )
+ {
+ return new Distance_km( value + distance.to_km().doubleValue() );
+ }
+
+ public Distance subtract( Distance distance )
+ {
+ return new Distance_km( value - distance.to_km().doubleValue() );
+ }
+
+ public Ratio divide( Distance distance )
+ {
+ return new Ratio_abs( this.value / distance.to_km().doubleValue() );
+ }
+
+ public Distance divide( Ratio ratio )
+ {
+ return new Distance_km( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Distance multiply( Ratio ratio )
+ {
+ return new Distance_km( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Distance_km(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Distance to_m()
+ {
+ return new Distance_m( value * 1000 );
+ }
+
+ public Distance to_mm()
+ {
+ return new Distance_mm( value * 1000000 );
+ }
+
+ public Distance to_cm()
+ {
+ return new Distance_cm( value * 100000 );
+ }
+
+ public Distance to_dm()
+ {
+ return new Distance_dm( value * 10000 );
+ }
+
+ public Distance to_km()
+ {
+ return new Distance_km( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_m.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_m.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,136 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.distance;
+
+import net.dpml.metric.*;
+import net.dpml.metric.area.Area_m2;
+import net.dpml.metric.volume.Volume_m3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Distance_m extends AbstractDistance
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "m" );
+ m_UnitName = ( "meter" );
+ }
+
+ public Distance_m( double value )
+ {
+ super( value );
+ }
+
+ public Area multiply( Distance distance )
+ {
+ return new Area_m2( value * distance.to_m().doubleValue() );
+ }
+
+ public Volume multiply( Area area )
+ {
+ return new Volume_m3( value * area.to_m2().doubleValue() );
+ }
+
+ public Distance add( Distance distance )
+ {
+ return new Distance_m( value + distance.to_m().doubleValue() );
+ }
+
+ public Distance subtract( Distance distance )
+ {
+ return new Distance_m( value - distance.to_m().doubleValue() );
+ }
+
+ public Ratio divide( Distance distance )
+ {
+ return new Ratio_abs( this.value / distance.to_m().doubleValue() );
+ }
+
+ public Distance divide( Ratio ratio )
+ {
+ return new Distance_m( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Distance multiply( Ratio ratio )
+ {
+ return new Distance_m( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Distance_m(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Distance to_m()
+ {
+ return new Distance_m( value );
+ }
+
+ public Distance to_mm()
+ {
+ return new Distance_mm( value * 1000 );
+ }
+
+ public Distance to_cm()
+ {
+ return new Distance_cm( value * 100 );
+ }
+
+ public Distance to_dm()
+ {
+ return new Distance_dm( value * 10 );
+ }
+
+ public Distance to_km()
+ {
+ return new Distance_km( value / 1000);
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_mm.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/distance/Distance_mm.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,136 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.distance;
+
+import net.dpml.metric.*;
+import net.dpml.metric.area.Area_mm2;
+import net.dpml.metric.volume.Volume_mm3;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Distance_mm extends AbstractDistance
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "mm" );
+ m_UnitName = ( "millimeter" );
+ }
+
+ public Distance_mm( double value )
+ {
+ super( value );
+ }
+
+ public Area multiply( Distance distance )
+ {
+ return new Area_mm2( value * distance.to_mm().doubleValue() );
+ }
+
+ public Volume multiply( Area area )
+ {
+ return new Volume_mm3( value * area.to_mm2().doubleValue() );
+ }
+
+ public Distance add( Distance distance )
+ {
+ return new Distance_mm( value + distance.to_mm().doubleValue() );
+ }
+
+ public Distance subtract( Distance distance )
+ {
+ return new Distance_mm( value - distance.to_mm().doubleValue() );
+ }
+
+ public Ratio divide( Distance distance )
+ {
+ return new Ratio_abs( this.value / distance.to_mm().doubleValue() );
+ }
+
+ public Distance divide( Ratio ratio )
+ {
+ return new Distance_mm( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Distance multiply( Ratio ratio )
+ {
+ return new Distance_mm( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Distance_mm(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Distance to_m()
+ {
+ return new Distance_m( value / 1000 );
+ }
+
+ public Distance to_mm()
+ {
+ return new Distance_mm( value );
+ }
+
+ public Distance to_cm()
+ {
+ return new Distance_cm( value / 10 );
+ }
+
+ public Distance to_dm()
+ {
+ return new Distance_dm( value / 100 );
+ }
+
+ public Distance to_km()
+ {
+ return new Distance_km( value / 1000000 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/AbstractEnergy.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/AbstractEnergy.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,41 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_m;
+
+public abstract class AbstractEnergy extends GenericMetric
+ implements Energy
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractEnergy( double value )
+ {
+ super( value );
+ }
+
+ public Distance divide( Force force )
+ {
+ return new Distance_m( to_J().doubleValue() /
force.to_N().doubleValue() );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_GJ.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_GJ.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,164 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_GJ extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "GJ" );
+ m_UnitName = ( "gigajoule" );
+ }
+
+ public Energy_GJ( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_GJ(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_GJ( value + energy.to_GJ().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_GJ( value - energy.to_GJ().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_GJ().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_GJ( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_GJ( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_GW( value / time.to_s().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value * 1000000000.0 );
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value * 1000000.0 );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value * 1000.0);
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value/1000.0 );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value * 1000000000.0 );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value * 1000000000.0 );
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value/0.0036 );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value/3.6 );
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value/3600 );
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value/3600000 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_GWh.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_GWh.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,165 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_GWh extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "GWh" );
+ m_UnitName = ( "gigawatt-hour" );
+ }
+
+ public Energy_GWh( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_GWh(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_GWh( value + energy.to_GWh().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_GWh( value - energy.to_GWh().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_GWh().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_GWh( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_GWh( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_GW( value / time.to_h().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value * 3600000000000.0);
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value * 3600000000.0 );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value * 3600000.0 );
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value * 3600 );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value * 3.6 );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value * 3600000000000.0 );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value * 3600000000000.0);
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value * 1000000.0 );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value * 1000.0);
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value );
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value / 1000.0 );
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_J.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_J.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,164 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_J extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "J" );
+ m_UnitName = ( "joule" );
+ }
+
+ public Energy_J( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_J(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_J( value + energy.to_J().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_J( value - energy.to_J().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_J().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_J( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_J( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_W( value / time.to_s().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value );
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value/1000.0 );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value/1000000.0 );
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value/1000000000.0 );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value/1000000000000.0 );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value );
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value/3600000.0 );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value/3600000000.0 );
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value/3600000000000.0 );
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value/3600000000000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_MJ.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_MJ.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,164 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_MJ extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "MJ" );
+ m_UnitName = ( "megajoule" );
+ }
+
+ public Energy_MJ( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_MJ(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_MJ( value + energy.to_MJ().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_MJ( value - energy.to_MJ().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_MJ().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_MJ( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_MJ( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_MW( value / time.to_s().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value * 1000000.0 );
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value * 1000.0 );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value );
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value/1000.0 );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value/1000000.0 );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value * 1000000.0 );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value * 1000000.0 );
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value/3.6 );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value/3600.0 );
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value/3600000.0 );
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value/3600000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_MWh.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_MWh.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,165 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_MWh extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "MWh" );
+ m_UnitName = ( "megawatt-hour" );
+ }
+
+ public Energy_MWh( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_MWh(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_MWh( value + energy.to_MWh().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_MWh( value - energy.to_MWh().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_MWh().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_MWh( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_MWh( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_MW( value / time.to_h().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value * 3600000000.0);
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value * 3600000.0 );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value * 3600.0 );
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value * 3.6 );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value* 0.0036 );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value * 3600000000.0 );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value * 3600000000.0);
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value * 1000.0 );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value );
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value / 1000.0);
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value / 1000000.0 );
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_Nm.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_Nm.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,164 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_Nm extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "Nm" );
+ m_UnitName = ( "newton-meter" );
+ }
+
+ public Energy_Nm( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_Nm(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_Nm( value + energy.to_Nm().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_Nm( value - energy.to_Nm().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_Nm().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_Nm( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_Nm( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_W( value / time.to_s().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value );
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value/1000.0 );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value/1000000.0 );
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value/1000000000.0 );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value/1000000000000.0 );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value );
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value/3600000.0 );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value/3600000000.0 );
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value/3600000000000.0 );
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value/3600000000000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_TJ.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_TJ.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,165 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_TJ extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "TJ" );
+ m_UnitName = ( "terajoule" );
+ }
+
+ public Energy_TJ( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_TJ(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_TJ( value + energy.to_TJ().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_TJ( value - energy.to_TJ().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_TJ().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_TJ( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_TJ( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_TW( value / time.to_s().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value * 1000000000000.0 );
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value * 1000000000.0 );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value * 1000000.0);
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value * 1000.0 );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value * 1000000000000.0 );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value * 1000000000000.0 );
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value/0.0000036 );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value/0.0036 );
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value/3.6 );
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value/3600 );
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_TWh.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_TWh.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,165 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_TWh extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "TWh" );
+ m_UnitName = ( "terawatt-hour" );
+ }
+
+ public Energy_TWh( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_TWh(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_TWh( value + energy.to_TWh().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_TWh( value - energy.to_TWh().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_TWh().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_TWh( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_TWh( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_TW( value / time.to_h().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value * 3600000000000000.0);
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value * 3600000000000.0 );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value * 3600000000.0 );
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value * 3600000 );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value * 3600 );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value * 3600000000000000.0 );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value * 3600000000000000.0);
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value * 1000000000.0 );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value * 1000000.0);
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value * 1000.0);
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value );
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_Ws.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_Ws.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,164 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_Ws extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "Ws" );
+ m_UnitName = ( "watt-second" );
+ }
+
+ public Energy_Ws( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_Ws(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_Ws( value + energy.to_Ws().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_Ws( value - energy.to_Ws().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_Ws().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_Ws( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_Ws( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_W( value / time.to_s().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value );
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value/1000.0 );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value/1000000.0 );
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value/1000000000.0 );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value/1000000000000.0 );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value );
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value/3600000.0 );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value/3600000000.0 );
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value/3600000000000.0 );
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value/3600000000000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_kJ.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_kJ.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,164 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_kJ extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "kJ" );
+ m_UnitName = ( "kilojoule" );
+ }
+
+ public Energy_kJ( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_kJ(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_kJ( value + energy.to_kJ().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_kJ( value - energy.to_kJ().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_kJ().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_kJ( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_kJ( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_kW( value / time.to_s().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value * 1000.0 );
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value/1000.0 );
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value/1000000.0 );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value/1000000000.0 );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value * 1000.0 );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value * 1000.0 );
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value/3600.0 );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value/3600000.0 );
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value/3600000000.0 );
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value/3600000000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_kWh.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/energy/Energy_kWh.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,165 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.energy;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.power.Power_GW;
+import net.dpml.metric.power.Power_MW;
+import net.dpml.metric.power.Power_TW;
+import net.dpml.metric.power.Power_kW;
+
+public final class Energy_kWh extends AbstractEnergy
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "kWh" );
+ m_UnitName = ( "kilowatt-hour" );
+ }
+
+ public Energy_kWh( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Energy_kWh(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Energy add( Energy energy )
+ {
+ return new Energy_kWh( value + energy.to_kWh().doubleValue() );
+ }
+
+ public Energy subtract( Energy energy )
+ {
+ return new Energy_kWh( value - energy.to_kWh().doubleValue() );
+ }
+
+ public Ratio divide( Energy energy )
+ {
+ return new Ratio_abs( value / energy.to_kWh().doubleValue() );
+ }
+
+ public Energy divide( Ratio ratio )
+ {
+ return new Energy_kWh( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Ratio ratio )
+ {
+ return new Energy_kWh( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Power divide( Time time )
+ {
+ return new Power_kW( value / time.to_h().doubleValue() );
+ }
+
+ public Energy to_J()
+ {
+ return new Energy_J( value * 3600000.0);
+ }
+
+ public Energy to_kJ()
+ {
+ return new Energy_kJ( value* 3600.0 );
+ }
+
+ public Energy to_MJ()
+ {
+ return new Energy_MJ( value* 3.6 );
+ }
+
+ public Energy to_GJ()
+ {
+ return new Energy_GJ( value * 0.0036 );
+ }
+
+ public Energy to_TJ()
+ {
+ return new Energy_TJ( value* 0.0000036 );
+ }
+
+ public Energy to_Nm()
+ {
+ return new Energy_Nm( value * 3600000 );
+ }
+
+ public Energy to_Ws()
+ {
+ return new Energy_Ws( value * 3600000);
+ }
+
+ public Energy to_kWh()
+ {
+ return new Energy_kWh( value );
+ }
+
+ public Energy to_MWh()
+ {
+ return new Energy_MWh( value/1000.0 );
+ }
+
+ public Energy to_GWh()
+ {
+ return new Energy_GWh( value/1000000.0 );
+ }
+
+ public Energy to_TWh()
+ {
+ return new Energy_TWh( value/1000000000.0 );
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/AbstractFlow.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/AbstractFlow.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,35 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.flow;
+
+import net.dpml.metric.*;
+
+public abstract class AbstractFlow extends GenericMetric
+ implements Flow
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractFlow( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_l_h.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_l_h.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,135 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.flow;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.volume.Volume_l;
+
+public final class Flow_l_h extends AbstractFlow
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "l/h" );
+ m_UnitName = ( "liters per hour" );
+ }
+
+ public Flow_l_h( double value )
+ {
+ super( value );
+ }
+
+ public Flow add( Flow flow)
+ {
+ return new Flow_l_h( value + flow.to_l_h().doubleValue() );
+ }
+
+ public Flow subtract( Flow flow )
+ {
+ return new Flow_l_h( value - flow.to_l_h().doubleValue() );
+ }
+
+ public Ratio divide( Flow flow )
+ {
+ return new Ratio_abs( value / flow.to_l_h().doubleValue() );
+ }
+
+ public Flow divide( Ratio ratio )
+ {
+ return new Flow_l_h( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Flow multiply( Ratio ratio )
+ {
+ return new Flow_l_h( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Time time )
+ {
+ return new Volume_l( this.value * time.to_h().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Flow_l_h(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Flow to_l_s()
+ {
+ return new Flow_l_s( value / 3600 );
+ }
+
+ public Flow to_l_m()
+ {
+ return new Flow_l_m( value / 60 );
+ }
+
+ public Flow to_l_h()
+ {
+ return new Flow_l_h( value );
+ }
+
+ public Flow to_m3_s()
+ {
+ return new Flow_m3_s( value / 3600000 );
+ }
+
+ public Flow to_m3_m()
+ {
+ return new Flow_m3_m( value / 60000 );
+ }
+
+ public Flow to_m3_h()
+ {
+ return new Flow_m3_h( value / 1000 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_l_m.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_l_m.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,135 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.flow;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.volume.Volume_l;
+
+public final class Flow_l_m extends AbstractFlow
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "l/m" );
+ m_UnitName = ( "liters per minute" );
+ }
+
+ public Flow_l_m( double value )
+ {
+ super( value );
+ }
+
+ public Flow add( Flow flow)
+ {
+ return new Flow_l_m( value + flow.to_l_m().doubleValue() );
+ }
+
+ public Flow subtract( Flow flow )
+ {
+ return new Flow_l_m( value - flow.to_l_m().doubleValue() );
+ }
+
+ public Ratio divide( Flow flow )
+ {
+ return new Ratio_abs( value / flow.to_l_m().doubleValue() );
+ }
+
+ public Flow divide( Ratio ratio )
+ {
+ return new Flow_l_m( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Flow multiply( Ratio ratio )
+ {
+ return new Flow_l_m( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Time time )
+ {
+ return new Volume_l( this.value * time.to_m().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Flow_l_m(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Flow to_l_s()
+ {
+ return new Flow_l_s( value / 60 );
+ }
+
+ public Flow to_l_m()
+ {
+ return new Flow_l_m( value );
+ }
+
+ public Flow to_l_h()
+ {
+ return new Flow_l_h( value * 60 );
+ }
+
+ public Flow to_m3_s()
+ {
+ return new Flow_m3_s( value / 60000 );
+ }
+
+ public Flow to_m3_m()
+ {
+ return new Flow_m3_m( value / 1000 );
+ }
+
+ public Flow to_m3_h()
+ {
+ return new Flow_m3_h( value * 0.06);
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_l_s.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_l_s.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,135 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.flow;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.volume.Volume_l;
+
+public final class Flow_l_s extends AbstractFlow
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "l/s" );
+ m_UnitName = ( "liters per second" );
+ }
+
+ public Flow_l_s( double value )
+ {
+ super( value );
+ }
+
+ public Flow add( Flow flow)
+ {
+ return new Flow_l_s( value + flow.to_l_s().doubleValue() );
+ }
+
+ public Flow subtract( Flow flow )
+ {
+ return new Flow_l_s( value - flow.to_l_s().doubleValue() );
+ }
+
+ public Ratio divide( Flow flow )
+ {
+ return new Ratio_abs( value / flow.to_l_s().doubleValue() );
+ }
+
+ public Flow divide( Ratio ratio )
+ {
+ return new Flow_l_s( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Flow multiply( Ratio ratio )
+ {
+ return new Flow_l_s( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Time time )
+ {
+ return new Volume_l( this.value * time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Flow_l_s(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Flow to_l_s()
+ {
+ return new Flow_l_s( value );
+ }
+
+ public Flow to_l_m()
+ {
+ return new Flow_l_m( value * 60);
+ }
+
+ public Flow to_l_h()
+ {
+ return new Flow_l_h( value * 3600 );
+ }
+
+ public Flow to_m3_s()
+ {
+ return new Flow_m3_s( value * 0.001 );
+ }
+
+ public Flow to_m3_m()
+ {
+ return new Flow_m3_m( value * 0.06 );
+ }
+
+ public Flow to_m3_h()
+ {
+ return new Flow_m3_h( value * 3.6);
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_m3_h.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_m3_h.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,135 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.flow;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.volume.Volume_m3;
+
+public final class Flow_m3_h extends AbstractFlow
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "m3/h" );
+ m_UnitName = ( "cubicmeters per hour" );
+ }
+
+ public Flow_m3_h( double value )
+ {
+ super( value );
+ }
+
+ public Flow add( Flow flow)
+ {
+ return new Flow_m3_h( value + flow.to_m3_h().doubleValue() );
+ }
+
+ public Flow subtract( Flow flow )
+ {
+ return new Flow_m3_h( value - flow.to_m3_h().doubleValue() );
+ }
+
+ public Ratio divide( Flow flow )
+ {
+ return new Ratio_abs( value / flow.to_m3_h().doubleValue() );
+ }
+
+ public Flow divide( Ratio ratio )
+ {
+ return new Flow_m3_h( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Flow multiply( Ratio ratio )
+ {
+ return new Flow_m3_h( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Time time )
+ {
+ return new Volume_m3( this.value * time.to_h().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Flow_m3_h(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Flow to_l_s()
+ {
+ return new Flow_l_s( value / 3.6 );
+ }
+
+ public Flow to_l_m()
+ {
+ return new Flow_l_m( value / 0.06 );
+ }
+
+ public Flow to_l_h()
+ {
+ return new Flow_l_h( value * 1000 );
+ }
+
+ public Flow to_m3_s()
+ {
+ return new Flow_m3_s( value / 3600 );
+ }
+
+ public Flow to_m3_m()
+ {
+ return new Flow_m3_m( value / 60);
+ }
+
+ public Flow to_m3_h()
+ {
+ return new Flow_m3_h( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_m3_m.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_m3_m.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,135 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.flow;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.volume.Volume_m3;
+
+public class Flow_m3_m extends AbstractFlow
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "m3/m" );
+ m_UnitName = ( "cubicmeters per minute" );
+ }
+
+ public Flow_m3_m( double value )
+ {
+ super( value );
+ }
+
+ public Flow add( Flow flow)
+ {
+ return new Flow_m3_m( value + flow.to_m3_m().doubleValue() );
+ }
+
+ public Flow subtract( Flow flow )
+ {
+ return new Flow_m3_m( value - flow.to_m3_m().doubleValue() );
+ }
+
+ public Ratio divide( Flow flow )
+ {
+ return new Ratio_abs( value / flow.to_m3_m().doubleValue() );
+ }
+
+ public Flow divide( Ratio ratio )
+ {
+ return new Flow_m3_m( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Flow multiply( Ratio ratio )
+ {
+ return new Flow_m3_m( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Time time )
+ {
+ return new Volume_m3( this.value * time.to_m().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Flow_m3_m(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Flow to_l_s()
+ {
+ return new Flow_l_s( value / 0.060 );
+ }
+
+ public Flow to_l_m()
+ {
+ return new Flow_l_m( value * 1000 );
+ }
+
+ public Flow to_l_h()
+ {
+ return new Flow_l_h( value * 60000 );
+ }
+
+ public Flow to_m3_s()
+ {
+ return new Flow_m3_s( value / 60 );
+ }
+
+ public Flow to_m3_m()
+ {
+ return new Flow_m3_m( value );
+ }
+
+ public Flow to_m3_h()
+ {
+ return new Flow_m3_h( value * 60 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_m3_s.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/flow/Flow_m3_s.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,135 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.flow;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.volume.Volume_m3;
+
+public final class Flow_m3_s extends AbstractFlow
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "m3/s" );
+ m_UnitName = ( "cubicmeters per second" );
+ }
+
+ public Flow_m3_s( double value )
+ {
+ super( value );
+ }
+
+ public Flow add( Flow flow)
+ {
+ return new Flow_m3_s( value + flow.to_m3_s().doubleValue() );
+ }
+
+ public Flow subtract( Flow flow )
+ {
+ return new Flow_m3_s( value - flow.to_m3_s().doubleValue() );
+ }
+
+ public Ratio divide( Flow flow )
+ {
+ return new Ratio_abs( value / flow.to_m3_s().doubleValue() );
+ }
+
+ public Flow divide( Ratio ratio )
+ {
+ return new Flow_m3_s( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Flow multiply( Ratio ratio )
+ {
+ return new Flow_m3_s( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Time time )
+ {
+ return new Volume_m3( this.value * time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Flow_m3_s(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Flow to_l_s()
+ {
+ return new Flow_l_s( value * 1000 );
+ }
+
+ public Flow to_l_m()
+ {
+ return new Flow_l_m( value * 60000 );
+ }
+
+ public Flow to_l_h()
+ {
+ return new Flow_l_h( value * 3600000 );
+ }
+
+ public Flow to_m3_s()
+ {
+ return new Flow_m3_s( value );
+ }
+
+ public Flow to_m3_m()
+ {
+ return new Flow_m3_m( value * 60 );
+ }
+
+ public Flow to_m3_h()
+ {
+ return new Flow_m3_h( value * 3600 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/force/AbstractForce.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/force/AbstractForce.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,35 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.force;
+
+import net.dpml.metric.*;
+
+public abstract class AbstractForce extends GenericMetric
+ implements Force
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractForce( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/force/Force_N.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/force/Force_N.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,110 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.force;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_J;
+
+public final class Force_N extends AbstractForce
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "N" );
+ m_UnitName = ( "newton" );
+ }
+
+ public Force_N( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Force_N(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Force add( Force force)
+ {
+ return new Force_N( value + force.to_N().doubleValue() );
+ }
+
+ public Force subtract( Force force )
+ {
+ return new Force_N( value - force.to_N().doubleValue() );
+ }
+
+ public Ratio divide( Force force)
+ {
+ return new Ratio_abs( value / force.to_N().doubleValue() );
+ }
+
+ public Force divide( Ratio ratio )
+ {
+ return new Force_N( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Force multiply( Ratio ratio )
+ {
+ return new Force_N( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Distance distance )
+ {
+ return new Energy_J( value * distance.to_m().doubleValue() );
+ }
+
+ public Force to_N()
+ {
+ return new Force_N( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/gravity/AbstractGravity.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/gravity/AbstractGravity.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,36 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.gravity;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public abstract class AbstractGravity extends GenericMetric
+ implements Gravity
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractGravity( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/gravity/Gravity_m_s2.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/gravity/Gravity_m_s2.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,104 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.gravity;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Gravity_m_s2 extends AbstractGravity
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "m/s";
+ m_UnitName = "meter per square-second";
+ }
+
+ public Gravity_m_s2(double value)
+ {
+ super(value );
+ }
+
+ public Gravity subtract( Gravity gravity )
+ {
+ return new Gravity_m_s2( this.value -
gravity.to_m_s2().doubleValue() );
+ }
+
+ public Gravity add( Gravity gravity )
+ {
+ return new Gravity_m_s2( this.value +
gravity.to_m_s2().doubleValue() );
+ }
+
+ public Ratio divide( Gravity gravity )
+ {
+ return new Ratio_abs( this.value / gravity.to_m_s2().doubleValue() );
+ }
+
+ public Gravity divide( Ratio ratio )
+ {
+ return new Gravity_m_s2( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Gravity multiply( Ratio ratio )
+ {
+ return new Gravity_m_s2( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Gravity_m_s2(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Gravity to_m_s2()
+ {
+ return new Gravity_m_s2( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/AbstractMass.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/AbstractMass.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,70 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.mass;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.density.Density_g_cm3;
+import net.dpml.metric.force.Force_N;
+
+public abstract class AbstractMass extends GenericMetric
+ implements Mass
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractMass( double value )
+ {
+ super( value );
+ }
+
+ public Ratio divide( Mass mass)
+ {
+ return new Ratio_abs( to_kg().doubleValue() /
mass.to_kg().doubleValue() );
+ }
+
+ public Energy multiply( Distance distance )
+ {
+ return new Energy_J( to_kg().doubleValue() *
distance.to_m().doubleValue() );
+ }
+
+ public Density divide( Volume volume )
+ {
+ return new Density_g_cm3( to_g().doubleValue() /
volume.to_cm3().doubleValue() );
+ }
+
+ public Force multiply( Acceleration acceleration )
+ {
+ return new Force_N( to_kg().doubleValue() *
acceleration.to_m_s2().doubleValue() );
+ }
+
+ public Energy compute( Gravity gravity, Distance height )
+ {
+ return new Energy_J( to_kg().doubleValue() *
gravity.to_m_s2().doubleValue() * height.to_m().doubleValue() );
+ }
+
+ public Energy compute( Velocity velocity )
+ {
+ double vel = velocity.to_m_s().doubleValue();
+ return new Energy_J( to_kg().doubleValue() * vel * vel / 2 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/Mass_g.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/Mass_g.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,108 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.mass;
+
+import net.dpml.metric.*;
+
+public final class Mass_g extends AbstractMass
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "g" );
+ m_UnitName = ( "gram" );
+ }
+
+ public Mass_g( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Mass_g(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Mass add( Mass mass)
+ {
+ return new Mass_g( value + mass.to_g().doubleValue() );
+ }
+
+ public Mass subtract( Mass mass )
+ {
+ return new Mass_g( value - mass.to_g().doubleValue() );
+ }
+
+ public Mass divide( Ratio ratio )
+ {
+ return new Mass_g( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Mass multiply( Ratio ratio )
+ {
+ return new Mass_g( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Mass to_kg()
+ {
+ return new Mass_kg( value / 1000.0 );
+ }
+
+ public Mass to_g()
+ {
+ return new Mass_g( value );
+ }
+
+ public Mass to_mg()
+ {
+ return new Mass_mg( value * 1000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/Mass_kg.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/Mass_kg.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,109 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.mass;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Mass_kg extends AbstractMass
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "kg" );
+ m_UnitName = ( "kilogram" );
+ }
+
+ public Mass_kg( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Mass_kg(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Mass add( Mass mass)
+ {
+ return new Mass_kg( value + mass.to_kg().doubleValue() );
+ }
+
+ public Mass subtract( Mass mass )
+ {
+ return new Mass_kg( value - mass.to_kg().doubleValue() );
+ }
+
+ public Mass divide( Ratio ratio )
+ {
+ return new Mass_kg( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Mass multiply( Ratio ratio )
+ {
+ return new Mass_kg( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Mass to_kg()
+ {
+ return new Mass_kg( value );
+ }
+
+ public Mass to_g()
+ {
+ return new Mass_g( value * 1000.0 );
+ }
+
+ public Mass to_mg()
+ {
+ return new Mass_mg( value * 1000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/Mass_mg.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/mass/Mass_mg.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,108 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.mass;
+
+import net.dpml.metric.*;
+
+public final class Mass_mg extends AbstractMass
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "mg" );
+ m_UnitName = ( "milligram" );
+ }
+
+ public Mass_mg( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Mass_mg(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Mass add( Mass mass)
+ {
+ return new Mass_mg( value + mass.to_mg().doubleValue() );
+ }
+
+ public Mass subtract( Mass mass )
+ {
+ return new Mass_mg( value - mass.to_mg().doubleValue() );
+ }
+
+ public Mass divide( Ratio ratio )
+ {
+ return new Mass_mg( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Mass multiply( Ratio ratio )
+ {
+ return new Mass_mg( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Mass to_kg()
+ {
+ return new Mass_kg( value / 1000000.0 );
+ }
+
+ public Mass to_g()
+ {
+ return new Mass_g( value / 1000.0 );
+ }
+
+ public Mass to_mg()
+ {
+ return new Mass_mg( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/AbstractPower.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/AbstractPower.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,35 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+
+public abstract class AbstractPower extends GenericMetric
+ implements Power
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractPower( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_GW.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_GW.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_GW extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "GW" );
+ m_UnitName = ( "gigawatt" );
+ }
+
+ public Power_GW( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_GW(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_GW( value + power.to_GW().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_GW( value - power.to_GW().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_GW().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_GW( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_GW( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_GWh( value * time.to_h().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value * 1000000000000.0);
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value * 1000000000.0);
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value * 1000000000.0);
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value * 1000000000.0);
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value * 1000000.0);
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value * 1000.0);
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 1000.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 8760000000.0 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value * 8760000.0 );
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value * 8760.0 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value * 8.76 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_GWh_y.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_GWh_y.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_GWh_y extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "W" );
+ m_UnitName = ( "watt" );
+ }
+
+ public Power_GWh_y( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_GWh_y(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_GWh_y( value + power.to_GWh_y().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_GWh_y( value - power.to_GWh_y().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_GWh_y().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_GWh_y( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_GWh_y( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_GWh( value * time.to_y().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value / 0.00000000876 );
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value / 0.00000876 );
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value / 0.00000876);
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value / 0.00000876);
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value / 0.00876 );
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value / 8.7600 );
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value / 8760.0 );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 8760000.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 1000000.0 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value * 1000.0);
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value / 1000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_J_s.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_J_s.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_J_s extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "J/s" );
+ m_UnitName = ( "joule per second" );
+ }
+
+ public Power_J_s( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_J_s(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_J_s( value + power.to_J_s().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_J_s( value - power.to_J_s().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_J_s().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_J_s( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_J_s( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_J( value * time.to_s().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value * 1000.0 );
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value );
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value );
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value );
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value / 1000.0 );
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value / 1000000.0 );
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value / 1000000000.0 );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 1000000000000.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 8.76 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value * 0.00876 );
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value * 0.00000876 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value * 0.00000000876 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_MW.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_MW.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_MW extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "MW" );
+ m_UnitName = ( "megawatt" );
+ }
+
+ public Power_MW( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_MW(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_MW( value + power.to_MW().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_MW( value - power.to_MW().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_MW().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_MW( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_MW( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_MWh( value * time.to_h().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value * 1000000000.0);
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value * 1000000.0);
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value * 1000000.0);
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value * 1000000.0);
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value * 1000.0);
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value );
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value / 1000.0 );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 1000000.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 8760000.0 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value * 8760.0 );
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value * 8.76 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value * 0.00876 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_MWh_y.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_MWh_y.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_MWh_y extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "MWh/year" );
+ m_UnitName = ( "megawatt-hour per year" );
+ }
+
+ public Power_MWh_y( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_MWh_y(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_MWh_y( value + power.to_MWh_y().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_MWh_y( value - power.to_MWh_y().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_MWh_y().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_MWh_y( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_MWh_y( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_MWh( value * time.to_y().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value / 0.00000876 );
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value / 0.00876 );
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value / 0.00876);
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value / 0.00876);
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value / 8.76 );
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value / 8760.0 );
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value / 8760000.0 );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 8760000000.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 1000.0 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value );
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value / 1000.0 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value / 1000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_Nm_s.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_Nm_s.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_Nm_s extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "Nm/s" );
+ m_UnitName = ( "newtown-meter per second" );
+ }
+
+ public Power_Nm_s( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_Nm_s(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_Nm_s( value + power.to_Nm_s().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_Nm_s( value - power.to_Nm_s().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_Nm_s().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_Nm_s( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_Nm_s( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_J( value * time.to_s().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value * 1000.0 );
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value );
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value );
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value );
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value / 1000.0 );
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value / 1000000.0 );
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value / 1000000000.0 );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 1000000000000.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 8.76 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value * 0.00876 );
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value * 0.00000876 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value * 0.00000000876 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_TW.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_TW.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_TW extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "TW" );
+ m_UnitName = ( "terawatt" );
+ }
+
+ public Power_TW( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_TW(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_TW( value + power.to_TW().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_TW( value - power.to_TW().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_TW().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_TW( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_TW( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_TWh( value * time.to_h().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value * 1000000000000000.0);
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value * 1000000000000.0);
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value * 1000000000000.0);
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value * 1000000000000.0);
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value * 1000000000.0);
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value * 1000000.0);
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value * 1000.0);
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 8760000000000.0 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value * 8760000000.0 );
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value * 8760000.0 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value * 8760.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_TWh_y.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_TWh_y.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_TWh_y extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "TWh/year" );
+ m_UnitName = ( "terawatt-hour per year" );
+ }
+
+ public Power_TWh_y( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_TWh_y(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_TWh_y( value + power.to_TWh_y().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_TWh_y( value - power.to_TWh_y().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_TWh_y().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_TWh_y( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_TWh_y( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_TWh( value * time.to_y().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value / 0.00000000000876 );
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value / 0.00000000876 );
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value / 0.00000000876);
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value / 0.00000000876);
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value / 0.00000876 );
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value / 0.00876 );
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value / 8.76 );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 8760.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 1000000000.0 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value * 1000000.0);
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value * 1000.0 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_W.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_W.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_W extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "W" );
+ m_UnitName = ( "watt" );
+ }
+
+ public Power_W( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_W(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_W( value + power.to_W().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_W( value - power.to_W().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_W().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_W( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_W( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_J( value * time.to_s().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value * 1000.0 );
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value );
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value );
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value );
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value / 1000.0 );
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value / 1000000.0 );
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value / 1000000000.0 );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 1000000000000.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 8.76 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value * 0.00876 );
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value * 0.00000876 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value * 0.00000000876 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_kW.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_kW.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_kW extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "kW" );
+ m_UnitName = ( "kilowatt" );
+ }
+
+ public Power_kW( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_kW(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_kW( value + power.to_kW().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_kW( value - power.to_kW().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_kW().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_kW( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_kW( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_kWh( value * time.to_h().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value * 1000000.0);
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value * 1000.0);
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value * 1000.0);
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value * 1000.0);
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value );
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value / 1000.0 );
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value / 1000000.0 );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 1000000000.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 8760.0 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value * 8.76 );
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value * 0.00876 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value * 0.00000876 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_kWh_y.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/Power_kWh_y.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.sub.Power_mW;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_kWh_y extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "kWh/year" );
+ m_UnitName = ( "kilowatt-hour per year" );
+ }
+
+ public Power_kWh_y( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_kWh_y(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_kWh_y( value + power.to_kWh_y().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_kWh_y( value - power.to_kWh_y().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_kWh_y().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_kWh_y( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_kWh_y( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_kWh( value * time.to_y().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value / 0.00876 );
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value / 8.76 );
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value / 8.76);
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value / 8.76);
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value / 8760.0 );
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value / 8760000.0 );
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value / 8760000000.0 );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 8760000000000.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value / 1000.0);
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value / 1000000.0 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value / 1000000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/power/sub/Power_mW.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/power/sub/Power_mW.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,195 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.power.sub;
+
+import net.dpml.metric.*;
+import net.dpml.metric.power.*;
+import net.dpml.metric.energy.Energy_kWh;
+import net.dpml.metric.energy.Energy_MWh;
+import net.dpml.metric.energy.Energy_GWh;
+import net.dpml.metric.energy.Energy_TWh;
+import net.dpml.metric.energy.Energy_J;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+
+public final class Power_mW extends AbstractPower
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "mW" );
+ m_UnitName = ( "milliwatt" );
+ }
+
+ public Power_mW( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Power_mW(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Power add( Power power )
+ {
+ return new Power_mW( value + power.to_mW().doubleValue() );
+ }
+
+ public Power subtract( Power power )
+ {
+ return new Power_mW( value - power.to_mW().doubleValue() );
+ }
+
+ public Ratio divide( Power power )
+ {
+ return new Ratio_abs( value / power.to_mW().doubleValue() );
+ }
+
+ public Power divide( Ratio ratio )
+ {
+ return new Power_mW( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Power multiply( Ratio ratio )
+ {
+ return new Power_mW( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Time time )
+ {
+ return new Energy_J( to_W().doubleValue() *
time.to_s().doubleValue() );
+ }
+
+ public Voltage divide( Current current )
+ {
+ return new Voltage_V( to_W().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( to_W().doubleValue() /
voltage.to_V().doubleValue() );
+ }
+
+ public Resistance computeResistance( Voltage voltage )
+ {
+ double volt = voltage.to_V().doubleValue();
+ return new Resistance_ohm( Math.pow(volt, 2) / to_W().doubleValue()
);
+ }
+
+ public Resistance computeResistance( Current current )
+ {
+ double cur = current.to_A().doubleValue();
+ return new Resistance_ohm( to_W().doubleValue() / Math.pow( cur, 2 )
);
+ }
+
+ public Power to_mW()
+ {
+ return new Power_mW( value );
+ }
+
+ public Power to_W()
+ {
+ return new Power_W( value / 1000.0);
+ }
+
+ public Power to_Nm_s()
+ {
+ return new Power_Nm_s( value / 1000.0);
+ }
+
+ public Power to_J_s()
+ {
+ return new Power_J_s( value / 1000.0);
+ }
+
+ public Power to_kW()
+ {
+ return new Power_kW( value / 1000000.0 );
+ }
+
+ public Power to_MW()
+ {
+ return new Power_MW( value / 1000000000.0 );
+ }
+
+ public Power to_GW()
+ {
+ return new Power_GW( value / 1000000000000.0 );
+ }
+
+ public Power to_TW()
+ {
+ return new Power_TW( value / 1000000000000000.0 );
+ }
+
+ public Power to_kWh_y()
+ {
+ return new Power_kWh_y( value * 0.00876 );
+ }
+
+ public Power to_MWh_y()
+ {
+ return new Power_MWh_y( value * 0.00000876 );
+ }
+
+ public Power to_GWh_y()
+ {
+ return new Power_GWh_y( value * 0.00000000876 );
+ }
+
+ public Power to_TWh_y()
+ {
+ return new Power_TWh_y( value * 0.00000000000876 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/AbstractPressure.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/AbstractPressure.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,43 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.pressure;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.force.Force_N;
+
+public abstract class AbstractPressure extends GenericMetric
+ implements Pressure
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractPressure( double value )
+ {
+ super( value );
+ }
+
+ public Force multiply( Area area )
+ {
+ return new Force_N( to_Pa().doubleValue() *
area.to_m2().doubleValue() );
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_MPa.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_MPa.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,124 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.pressure;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Pressure_MPa extends AbstractPressure
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "MPa";
+ m_UnitName = "megapascal";
+ }
+
+ public Pressure_MPa(double value)
+ {
+ super(value );
+ }
+
+ public Pressure subtract( Pressure pressure )
+ {
+ return new Pressure_MPa( this.value -
pressure.to_MPa().doubleValue() );
+ }
+
+ public Pressure add( Pressure pressure )
+ {
+ return new Pressure_MPa( this.value +
pressure.to_MPa().doubleValue() );
+ }
+
+ public Ratio divide( Pressure pressure )
+ {
+ return new Ratio_abs( this.value / pressure.to_MPa().doubleValue() );
+ }
+
+ public Pressure divide( Ratio ratio )
+ {
+ return new Pressure_MPa( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Pressure multiply( Ratio ratio )
+ {
+ return new Pressure_MPa( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Pressure_MPa(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Pressure to_Pa()
+ {
+ return new Pressure_Pa( value * 1000000.0 );
+ }
+
+ public Pressure to_kPa()
+ {
+ return new Pressure_kPa( value * 1000.0 );
+ }
+
+ public Pressure to_MPa()
+ {
+ return new Pressure_MPa( value );
+ }
+
+ public Pressure to_bar()
+ {
+ return new Pressure_bar( value * 10.0 );
+ }
+
+ public Pressure to_mbar()
+ {
+ return new Pressure_mbar( value * 10000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_Pa.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_Pa.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,124 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.pressure;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Pressure_Pa extends AbstractPressure
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "Pa";
+ m_UnitName = "pascal";
+ }
+
+ public Pressure_Pa(double value)
+ {
+ super(value );
+ }
+
+ public Pressure subtract( Pressure pressure )
+ {
+ return new Pressure_Pa( this.value - pressure.to_Pa().doubleValue()
);
+ }
+
+ public Pressure add( Pressure pressure )
+ {
+ return new Pressure_Pa( this.value + pressure.to_Pa().doubleValue()
);
+ }
+
+ public Ratio divide( Pressure pressure )
+ {
+ return new Ratio_abs( this.value / pressure.to_Pa().doubleValue() );
+ }
+
+ public Pressure divide( Ratio ratio )
+ {
+ return new Pressure_Pa( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Pressure multiply( Ratio ratio )
+ {
+ return new Pressure_Pa( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Pressure_Pa(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Pressure to_Pa()
+ {
+ return new Pressure_Pa( value );
+ }
+
+ public Pressure to_kPa()
+ {
+ return new Pressure_kPa( value / 1000.0 );
+ }
+
+ public Pressure to_MPa()
+ {
+ return new Pressure_MPa( value / 1000000.0 );
+ }
+
+ public Pressure to_bar()
+ {
+ return new Pressure_bar( value / 100000.0 );
+ }
+
+ public Pressure to_mbar()
+ {
+ return new Pressure_mbar( value / 100.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_bar.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_bar.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,124 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.pressure;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Pressure_bar extends AbstractPressure
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "bar";
+ m_UnitName = "bar";
+ }
+
+ public Pressure_bar(double value)
+ {
+ super(value );
+ }
+
+ public Pressure subtract( Pressure pressure )
+ {
+ return new Pressure_bar( this.value -
pressure.to_bar().doubleValue() );
+ }
+
+ public Pressure add( Pressure pressure )
+ {
+ return new Pressure_bar( this.value +
pressure.to_bar().doubleValue() );
+ }
+
+ public Ratio divide( Pressure pressure )
+ {
+ return new Ratio_abs( this.value / pressure.to_bar().doubleValue() );
+ }
+
+ public Pressure divide( Ratio ratio )
+ {
+ return new Pressure_bar( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Pressure multiply( Ratio ratio )
+ {
+ return new Pressure_bar( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Pressure_bar(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Pressure to_Pa()
+ {
+ return new Pressure_Pa( value * 100000.0 );
+ }
+
+ public Pressure to_kPa()
+ {
+ return new Pressure_kPa( value * 100.0 );
+ }
+
+ public Pressure to_MPa()
+ {
+ return new Pressure_MPa( value / 10.0 );
+ }
+
+ public Pressure to_bar()
+ {
+ return new Pressure_bar( value );
+ }
+
+ public Pressure to_mbar()
+ {
+ return new Pressure_mbar( value * 1000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_kPa.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_kPa.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,124 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.pressure;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Pressure_kPa extends AbstractPressure
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "kPa";
+ m_UnitName = "kilopascal";
+ }
+
+ public Pressure_kPa(double value)
+ {
+ super(value );
+ }
+
+ public Pressure subtract( Pressure pressure )
+ {
+ return new Pressure_kPa( this.value -
pressure.to_kPa().doubleValue() );
+ }
+
+ public Pressure add( Pressure pressure )
+ {
+ return new Pressure_kPa( this.value +
pressure.to_kPa().doubleValue() );
+ }
+
+ public Ratio divide( Pressure pressure )
+ {
+ return new Ratio_abs( this.value / pressure.to_kPa().doubleValue() );
+ }
+
+ public Pressure divide( Ratio ratio )
+ {
+ return new Pressure_kPa( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Pressure multiply( Ratio ratio )
+ {
+ return new Pressure_kPa( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Pressure_kPa(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Pressure to_Pa()
+ {
+ return new Pressure_Pa( value * 1000.0 );
+ }
+
+ public Pressure to_kPa()
+ {
+ return new Pressure_kPa( value );
+ }
+
+ public Pressure to_MPa()
+ {
+ return new Pressure_MPa( value / 1000.0 );
+ }
+
+ public Pressure to_bar()
+ {
+ return new Pressure_bar( value / 100.0 );
+ }
+
+ public Pressure to_mbar()
+ {
+ return new Pressure_mbar( value * 10.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_mbar.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/pressure/Pressure_mbar.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,124 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.pressure;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Pressure_mbar extends AbstractPressure
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "mbar";
+ m_UnitName = "millibar";
+ }
+
+ public Pressure_mbar(double value)
+ {
+ super(value );
+ }
+
+ public Pressure subtract( Pressure pressure )
+ {
+ return new Pressure_mbar( this.value -
pressure.to_mbar().doubleValue() );
+ }
+
+ public Pressure add( Pressure pressure )
+ {
+ return new Pressure_mbar( this.value +
pressure.to_mbar().doubleValue() );
+ }
+
+ public Ratio divide( Pressure pressure )
+ {
+ return new Ratio_abs( this.value / pressure.to_mbar().doubleValue()
);
+ }
+
+ public Pressure divide( Ratio ratio )
+ {
+ return new Pressure_mbar( this.value / ratio.to_abs().doubleValue()
);
+ }
+
+ public Pressure multiply( Ratio ratio )
+ {
+ return new Pressure_mbar( this.value * ratio.to_abs().doubleValue()
);
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Pressure_mbar(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Pressure to_Pa()
+ {
+ return new Pressure_Pa( value * 100.0 );
+ }
+
+ public Pressure to_kPa()
+ {
+ return new Pressure_kPa( value / 10.0 );
+ }
+
+ public Pressure to_MPa()
+ {
+ return new Pressure_MPa( value / 10000.0 );
+ }
+
+ public Pressure to_bar()
+ {
+ return new Pressure_bar( value / 1000.0);
+ }
+
+ public Pressure to_mbar()
+ {
+ return new Pressure_mbar( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/ratio/AbstractRatio.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/ratio/AbstractRatio.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,35 @@
+/*
+ * 0.98 99/01/12 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.ratio;
+
+import net.dpml.metric.*;
+
+public abstract class AbstractRatio extends GenericMetric
+ implements Ratio
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractRatio( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/ratio/Ratio_abs.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/ratio/Ratio_abs.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,94 @@
+/*
+ * 0.98 99/01/12 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.ratio;
+
+import net.dpml.metric.*;
+
+public final class Ratio_abs extends AbstractRatio
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "" );
+ m_UnitName = ( "" );
+ }
+
+ public Ratio_abs( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Ratio_abs(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Ratio add( Ratio ratio )
+ {
+ return new Ratio_abs( value + ratio.to_abs().doubleValue() );
+ }
+
+ public Ratio subtract( Ratio ratio )
+ {
+ return new Ratio_abs( value - ratio.to_abs().doubleValue() );
+ }
+
+ public Ratio to_pc()
+ {
+ return new Ratio_pc( value * 100 );
+ }
+
+ public Ratio to_abs()
+ {
+ return new Ratio_abs( value );
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/ratio/Ratio_pc.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/ratio/Ratio_pc.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,94 @@
+/*
+ * 0.98 99/01/12 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.ratio;
+
+import net.dpml.metric.*;
+
+public final class Ratio_pc extends AbstractRatio
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "%" );
+ m_UnitName = ( "percent" );
+ }
+
+ public Ratio_pc( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Ratio_pc(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Ratio add( Ratio ratio )
+ {
+ return new Ratio_pc( value + ratio.to_pc().doubleValue() );
+ }
+
+ public Ratio subtract( Ratio ratio )
+ {
+ return new Ratio_pc( value - ratio.to_pc().doubleValue() );
+ }
+
+ public Ratio to_pc()
+ {
+ return new Ratio_pc( value );
+ }
+
+ public Ratio to_abs()
+ {
+ return new Ratio_abs( value / 100.0 );
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/AbstractResistance.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/AbstractResistance.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,38 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.resistance;
+
+import net.dpml.metric.*;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public abstract class AbstractResistance extends GenericMetric
+ implements Resistance
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractResistance( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/Resistance_Mohm.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/Resistance_Mohm.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,133 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.resistance;
+
+import net.dpml.metric.*;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+
+public final class Resistance_Mohm extends AbstractResistance
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "kohm" );
+ m_UnitName = ( "kilo-ohm" );
+ }
+
+ public Resistance_Mohm( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Resistance_Mohm(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Resistance add( Resistance resistance)
+ {
+ return new Resistance_Mohm( value +
resistance.to_Mohm().doubleValue() );
+ }
+
+ public Resistance subtract( Resistance resistance )
+ {
+ return new Resistance_Mohm( value -
resistance.to_Mohm().doubleValue() );
+ }
+
+ public Ratio divide( Resistance resistance)
+ {
+ return new Ratio_abs( value / resistance.to_Mohm().doubleValue() );
+ }
+
+ public Resistance divide( Ratio ratio )
+ {
+ return new Resistance_Mohm( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance multiply( Ratio ratio )
+ {
+ return new Resistance_Mohm( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( voltage.to_V().doubleValue() /
to_ohm().doubleValue() );
+ }
+
+ public Voltage multiply( Current current )
+ {
+ return new Voltage_V( to_ohm().doubleValue() *
current.to_A().doubleValue() );
+ }
+
+ public Power computePower( Current current )
+ {
+ double amp = current.to_A().doubleValue();
+ return new Power_W( amp * amp * to_ohm().doubleValue() );
+ }
+
+ public Resistance to_ohm()
+ {
+ return new Resistance_ohm( value * 1000000.0);
+ }
+
+ public Resistance to_kohm()
+ {
+ return new Resistance_kohm( value * 1000.0);
+ }
+
+ public Resistance to_Mohm()
+ {
+ return new Resistance_Mohm( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/Resistance_kohm.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/Resistance_kohm.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,133 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.resistance;
+
+import net.dpml.metric.*;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+
+public final class Resistance_kohm extends AbstractResistance
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "kohm" );
+ m_UnitName = ( "kilo-ohm" );
+ }
+
+ public Resistance_kohm( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Resistance_kohm(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Resistance add( Resistance resistance)
+ {
+ return new Resistance_kohm( value +
resistance.to_kohm().doubleValue() );
+ }
+
+ public Resistance subtract( Resistance resistance )
+ {
+ return new Resistance_kohm( value -
resistance.to_kohm().doubleValue() );
+ }
+
+ public Ratio divide( Resistance resistance)
+ {
+ return new Ratio_abs( value / resistance.to_kohm().doubleValue() );
+ }
+
+ public Resistance divide( Ratio ratio )
+ {
+ return new Resistance_kohm( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance multiply( Ratio ratio )
+ {
+ return new Resistance_kohm( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( voltage.to_V().doubleValue() /
to_ohm().doubleValue() );
+ }
+
+ public Voltage multiply( Current current )
+ {
+ return new Voltage_V( to_ohm().doubleValue() *
current.to_A().doubleValue() );
+ }
+
+ public Power computePower( Current current )
+ {
+ double amp = current.to_A().doubleValue();
+ return new Power_W( amp * amp * to_ohm().doubleValue() );
+ }
+
+ public Resistance to_ohm()
+ {
+ return new Resistance_ohm( value * 1000.0);
+ }
+
+ public Resistance to_kohm()
+ {
+ return new Resistance_kohm( value );
+ }
+
+ public Resistance to_Mohm()
+ {
+ return new Resistance_Mohm( value / 1000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/Resistance_ohm.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/resistance/Resistance_ohm.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,133 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.resistance;
+
+import net.dpml.metric.*;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.voltage.Voltage_V;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.power.Power_W;
+
+public final class Resistance_ohm extends AbstractResistance
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "ohm" );
+ m_UnitName = ( "ohm" );
+ }
+
+ public Resistance_ohm( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Resistance_ohm(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Resistance add( Resistance resistance)
+ {
+ return new Resistance_ohm( value + resistance.to_ohm().doubleValue()
);
+ }
+
+ public Resistance subtract( Resistance resistance )
+ {
+ return new Resistance_ohm( value - resistance.to_ohm().doubleValue()
);
+ }
+
+ public Ratio divide( Resistance resistance)
+ {
+ return new Ratio_abs( value / resistance.to_ohm().doubleValue() );
+ }
+
+ public Resistance divide( Ratio ratio )
+ {
+ return new Resistance_ohm( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance multiply( Ratio ratio )
+ {
+ return new Resistance_ohm( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Current divide( Voltage voltage )
+ {
+ return new Current_A( voltage.to_V().doubleValue() /
to_ohm().doubleValue() );
+ }
+
+ public Voltage multiply( Current current )
+ {
+ return new Voltage_V( to_ohm().doubleValue() *
current.to_A().doubleValue() );
+ }
+
+ public Power computePower( Current current )
+ {
+ double amp = current.to_A().doubleValue();
+ return new Power_W( amp * amp * to_ohm().doubleValue() );
+ }
+
+ public Resistance to_ohm()
+ {
+ return new Resistance_ohm( value );
+ }
+
+ public Resistance to_kohm()
+ {
+ return new Resistance_kohm( value / 1000.0 );
+ }
+
+ public Resistance to_Mohm()
+ {
+ return new Resistance_Mohm( value / 1000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/AbstractTemperature.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/AbstractTemperature.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,35 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.temperature;
+
+import net.dpml.metric.*;
+
+public abstract class AbstractTemperature extends GenericMetric
+ implements Temperature
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractTemperature( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/Temperature_C.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/Temperature_C.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,98 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.temperature;
+
+import net.dpml.metric.*;
+
+public final class Temperature_C extends AbstractTemperature
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "C" );
+ m_UnitName = ( "degree Celsius" );
+ }
+
+ public Temperature_C( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Temperature_C(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Temperature add( Temperature temperature )
+ {
+ return new Temperature_C( value + temperature.to_C().doubleValue() );
+ }
+
+ public Temperature subtract( Temperature temperature )
+ {
+ return new Temperature_C( value - temperature.to_C().doubleValue() );
+ }
+
+ public Temperature to_C()
+ {
+ return new Temperature_C(value);
+ }
+
+ public Temperature to_F()
+ {
+ return new Temperature_F(value * 1.8 + 32 );
+ }
+
+ public Temperature to_K()
+ {
+ return new Temperature_K(value + 273.16);
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/Temperature_F.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/Temperature_F.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,98 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.temperature;
+
+import net.dpml.metric.*;
+
+public final class Temperature_F extends AbstractTemperature
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "F" );
+ m_UnitName = ( "degree Fahrenheit" );
+ }
+
+ public Temperature_F( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Temperature_F(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Temperature add( Temperature temperature )
+ {
+ return new Temperature_K( value + temperature.to_K().doubleValue() );
+ }
+
+ public Temperature subtract( Temperature temperature )
+ {
+ return new Temperature_K( value - temperature.to_K().doubleValue() );
+ }
+
+ public Temperature to_C()
+ {
+ return new Temperature_C((value-32)/1.8);
+ }
+
+ public Temperature to_F()
+ {
+ return new Temperature_F(value);
+ }
+
+ public Temperature to_K()
+ {
+ return new Temperature_K((value - 523.688)/1.8);
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/Temperature_K.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/temperature/Temperature_K.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,98 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.temperature;
+
+import net.dpml.metric.*;
+
+public final class Temperature_K extends AbstractTemperature
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "K" );
+ m_UnitName = ( "degree Kelvin" );
+ }
+
+ public Temperature_K( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Temperature_K(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Temperature add( Temperature temperature )
+ {
+ return new Temperature_K( value + temperature.to_K().doubleValue() );
+ }
+
+ public Temperature subtract( Temperature temperature )
+ {
+ return new Temperature_K( value - temperature.to_K().doubleValue() );
+ }
+
+ public Temperature to_C()
+ {
+ return new Temperature_C(value+273.16);
+ }
+
+ public Temperature to_F()
+ {
+ return new Temperature_F(value * 1.8 + 523.688);
+ }
+
+ public Temperature to_K()
+ {
+ return new Temperature_K(value);
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/AbstractTime.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/AbstractTime.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,37 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_kWh;
+
+public abstract class AbstractTime extends GenericMetric
+ implements Time
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractTime( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_d.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_d.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,156 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_kWh;
+
+public final class Time_d extends AbstractTime
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "d" );
+ m_UnitName = ( "day" );
+ }
+
+ public Time_d( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Time_d(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Time add( Time time )
+ {
+ return new Time_d( value + time.to_d().doubleValue() );
+ }
+
+ public Time subtract( Time time )
+ {
+ return new Time_d( value - time.to_d().doubleValue() );
+ }
+
+ public Ratio divide( Time time )
+ {
+ return new Ratio_abs( this.value / time.to_d().doubleValue() );
+ }
+
+ public Time divide( Ratio ratio )
+ {
+ return new Time_d( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Time multiply( Ratio ratio )
+ {
+ return new Time_d( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Power power )
+ {
+ return new Energy_kWh( to_h().doubleValue() *
power.to_kW().doubleValue() );
+ }
+
+ public Time to_ps()
+ {
+ return new Time_ps(value*86400000000000000.0);
+ }
+
+ public Time to_ns()
+ {
+ return new Time_ns(value*86400000000000.0);
+ }
+
+ public Time to_us()
+ {
+ return new Time_us(value*86400000000.0);
+ }
+
+ public Time to_ms()
+ {
+ return new Time_ms(value*86400000.0);
+ }
+
+ public Time to_s()
+ {
+ return new Time_s(value*86400.0);
+ }
+
+ public Time to_m()
+ {
+ return new Time_m(value*1440.0);
+ }
+
+ public Time to_h()
+ {
+ return new Time_h(value*24.0);
+ }
+
+ public Time to_d()
+ {
+ return new Time_d(value);
+ }
+
+ public Time to_w()
+ {
+ return new Time_w(value/7.0);
+ }
+
+ public Time to_y()
+ {
+ return new Time_y(value/365.0); // 365 days!!!
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_h.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_h.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,156 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_kWh;
+
+public final class Time_h extends AbstractTime
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "h" );
+ m_UnitName = ( "hour" );
+ }
+
+ public Time_h( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Time_h(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Time add( Time time )
+ {
+ return new Time_h( value + time.to_h().doubleValue() );
+ }
+
+ public Time subtract( Time time )
+ {
+ return new Time_h( value - time.to_h().doubleValue() );
+ }
+
+ public Ratio divide( Time time )
+ {
+ return new Ratio_abs( this.value / time.to_h().doubleValue() );
+ }
+
+ public Time divide( Ratio ratio )
+ {
+ return new Time_h( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Time multiply( Ratio ratio )
+ {
+ return new Time_h( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Power power )
+ {
+ return new Energy_kWh( to_h().doubleValue() *
power.to_kW().doubleValue() );
+ }
+
+ public Time to_ps()
+ {
+ return new Time_ps(value*3600000000000000.0);
+ }
+
+ public Time to_ns()
+ {
+ return new Time_ns(value*3600000000000.0);
+ }
+
+ public Time to_us()
+ {
+ return new Time_us(value*3600000000.0);
+ }
+
+ public Time to_ms()
+ {
+ return new Time_ms(value*3600000.0);
+ }
+
+ public Time to_s()
+ {
+ return new Time_s(value*3600.0);
+ }
+
+ public Time to_m()
+ {
+ return new Time_m(value*60.0);
+ }
+
+ public Time to_h()
+ {
+ return new Time_h(value);
+ }
+
+ public Time to_d()
+ {
+ return new Time_d(value/24.0);
+ }
+
+ public Time to_w()
+ {
+ return new Time_w(value/168.0);
+ }
+
+ public Time to_y()
+ {
+ return new Time_y(value/8760.0); // 365 days!!!
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_m.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_m.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,156 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_kWh;
+
+public final class Time_m extends AbstractTime
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "min" );
+ m_UnitName = ( "minute" );
+ }
+
+ public Time_m( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Time_m(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Time add( Time time )
+ {
+ return new Time_m( value + time.to_m().doubleValue() );
+ }
+
+ public Time subtract( Time time )
+ {
+ return new Time_m( value - time.to_m().doubleValue() );
+ }
+
+ public Ratio divide( Time time )
+ {
+ return new Ratio_abs( this.value / time.to_m().doubleValue() );
+ }
+
+ public Time divide( Ratio ratio )
+ {
+ return new Time_m( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Time multiply( Ratio ratio )
+ {
+ return new Time_m( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Power power )
+ {
+ return new Energy_kWh( to_h().doubleValue() *
power.to_kW().doubleValue() );
+ }
+
+ public Time to_ps()
+ {
+ return new Time_ps(value*60000000000000.0);
+ }
+
+ public Time to_ns()
+ {
+ return new Time_ns(value*60000000000.0);
+ }
+
+ public Time to_us()
+ {
+ return new Time_us(value*60000000.0);
+ }
+
+ public Time to_ms()
+ {
+ return new Time_ms(value*60000.0);
+ }
+
+ public Time to_s()
+ {
+ return new Time_s(value*60.0);
+ }
+
+ public Time to_m()
+ {
+ return new Time_m(value);
+ }
+
+ public Time to_h()
+ {
+ return new Time_h(value/60.0);
+ }
+
+ public Time to_d()
+ {
+ return new Time_d(value/1440.0);
+ }
+
+ public Time to_w()
+ {
+ return new Time_w(value/10080.0);
+ }
+
+ public Time to_y()
+ {
+ return new Time_y(value/525600.0); // 365 days!!!
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_ms.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_ms.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,156 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_J;
+
+public final class Time_ms extends AbstractTime
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "ms" );
+ m_UnitName = ( "millisecond" );
+ }
+
+ public Time_ms( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Time_ms(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Time add( Time time )
+ {
+ return new Time_ms( value + time.to_ms().doubleValue() );
+ }
+
+ public Time subtract( Time time )
+ {
+ return new Time_ms( value - time.to_ms().doubleValue() );
+ }
+
+ public Ratio divide( Time time )
+ {
+ return new Ratio_abs( this.value / time.to_ms().doubleValue() );
+ }
+
+ public Time divide( Ratio ratio )
+ {
+ return new Time_ms( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Time multiply( Ratio ratio )
+ {
+ return new Time_ms( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Power power )
+ {
+ return new Energy_J( to_s().doubleValue() *
power.to_W().doubleValue() );
+ }
+
+ public Time to_ps()
+ {
+ return new Time_ps( value * 1000000000.0 );
+ }
+
+ public Time to_ns()
+ {
+ return new Time_ns( value * 1000000.0);
+ }
+
+ public Time to_us()
+ {
+ return new Time_us( value * 1000.0 );
+ }
+
+ public Time to_ms()
+ {
+ return new Time_ms( value );
+ }
+
+ public Time to_s()
+ {
+ return new Time_s(value / 1000.0);
+ }
+
+ public Time to_m()
+ {
+ return new Time_m(value / 60000.0);
+ }
+
+ public Time to_h()
+ {
+ return new Time_h(value / 3600000.0);
+ }
+
+ public Time to_d()
+ {
+ return new Time_d(value / 86400000.0 );
+ }
+
+ public Time to_w()
+ {
+ return new Time_w(value / 604800000.0 );
+ }
+
+ public Time to_y()
+ {
+ return new Time_y(value / 31536000000.0); // 365 days!!!
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_ns.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_ns.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,155 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_J;
+
+public final class Time_ns extends AbstractTime
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "ns" );
+ m_UnitName = ( "nanosecond" );
+ }
+
+ public Time_ns( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Time_ns(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Time add( Time time )
+ {
+ return new Time_ns( value + time.to_ns().doubleValue() );
+ }
+
+ public Time subtract( Time time )
+ {
+ return new Time_ns( value - time.to_ns().doubleValue() );
+ }
+
+ public Ratio divide( Time time )
+ {
+ return new Ratio_abs( this.value / time.to_ns().doubleValue() );
+ }
+
+ public Time divide( Ratio ratio )
+ {
+ return new Time_ns( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Time multiply( Ratio ratio )
+ {
+ return new Time_ns( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Power power )
+ {
+ return new Energy_J( to_s().doubleValue() *
power.to_W().doubleValue() );
+ }
+
+ public Time to_ps()
+ {
+ return new Time_ps( value * 1000.0 );
+ }
+
+ public Time to_ns()
+ {
+ return new Time_ns( value );
+ }
+
+ public Time to_us()
+ {
+ return new Time_us( value / 1000.0);
+ }
+
+ public Time to_ms()
+ {
+ return new Time_ms( value / 1000000.0 );
+ }
+
+ public Time to_s()
+ {
+ return new Time_s(value / 1000000000.0);
+ }
+
+ public Time to_m()
+ {
+ return new Time_m(value / 60000000000.0);
+ }
+
+ public Time to_h()
+ {
+ return new Time_h(value / 3600000000000.0);
+ }
+
+ public Time to_d()
+ {
+ return new Time_d(value / 86400000000000.0 );
+ }
+
+ public Time to_w()
+ {
+ return new Time_w(value / 604800000000000.0 );
+ }
+
+ public Time to_y()
+ {
+ return new Time_y(value / 31536000000000000.0); // 365 days!!!
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_ps.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_ps.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,155 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_J;
+
+public final class Time_ps extends AbstractTime
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "ps" );
+ m_UnitName = ( "picosecond" );
+ }
+
+ public Time_ps( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Time_ps(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Time add( Time time )
+ {
+ return new Time_ps( value + time.to_ps().doubleValue() );
+ }
+
+ public Time subtract( Time time )
+ {
+ return new Time_ps( value - time.to_ps().doubleValue() );
+ }
+
+ public Ratio divide( Time time )
+ {
+ return new Ratio_abs( this.value / time.to_ps().doubleValue() );
+ }
+
+ public Time divide( Ratio ratio )
+ {
+ return new Time_ps( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Time multiply( Ratio ratio )
+ {
+ return new Time_ps( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Power power )
+ {
+ return new Energy_J( to_s().doubleValue() *
power.to_W().doubleValue() );
+ }
+
+ public Time to_ps()
+ {
+ return new Time_ps( value );
+ }
+
+ public Time to_ns()
+ {
+ return new Time_ns( value / 1000.0);
+ }
+
+ public Time to_us()
+ {
+ return new Time_us( value / 1000000.0);
+ }
+
+ public Time to_ms()
+ {
+ return new Time_ms( value / 1000000000.0 );
+ }
+
+ public Time to_s()
+ {
+ return new Time_s(value / 1000000000000.0);
+ }
+
+ public Time to_m()
+ {
+ return new Time_m(value / 60000000000000.0);
+ }
+
+ public Time to_h()
+ {
+ return new Time_h(value / 3600000000000000.0);
+ }
+
+ public Time to_d()
+ {
+ return new Time_d(value / 86400000000000000.0 );
+ }
+
+ public Time to_w()
+ {
+ return new Time_w(value / 604800000000000000.0 );
+ }
+
+ public Time to_y()
+ {
+ return new Time_y(value / 31536000000000000000.0); // 365 days!!!
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_s.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_s.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,156 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_J;
+
+public final class Time_s extends AbstractTime
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "s" );
+ m_UnitName = ( "second" );
+ }
+
+ public Time_s( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Time_s(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Time add( Time time )
+ {
+ return new Time_s( value + time.to_s().doubleValue() );
+ }
+
+ public Time subtract( Time time )
+ {
+ return new Time_s( value - time.to_s().doubleValue() );
+ }
+
+ public Ratio divide( Time time )
+ {
+ return new Ratio_abs( this.value / time.to_s().doubleValue() );
+ }
+
+ public Time divide( Ratio ratio )
+ {
+ return new Time_s( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Time multiply( Ratio ratio )
+ {
+ return new Time_s( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Power power )
+ {
+ return new Energy_J( to_s().doubleValue() *
power.to_W().doubleValue() );
+ }
+
+ public Time to_ps()
+ {
+ return new Time_ps(value * 1000000000000.0);
+ }
+
+ public Time to_ns()
+ {
+ return new Time_ns(value * 1000000000.0);
+ }
+
+ public Time to_us()
+ {
+ return new Time_us(value * 1000000.0);
+ }
+
+ public Time to_ms()
+ {
+ return new Time_ms(value * 1000.0);
+ }
+
+ public Time to_s()
+ {
+ return new Time_s(value);
+ }
+
+ public Time to_m()
+ {
+ return new Time_m(value/60.0);
+ }
+
+ public Time to_h()
+ {
+ return new Time_h(value/3600.0);
+ }
+
+ public Time to_d()
+ {
+ return new Time_d(value/86400.0);
+ }
+
+ public Time to_w()
+ {
+ return new Time_w(value/604800.0);
+ }
+
+ public Time to_y()
+ {
+ return new Time_y(value/31536000.0); // 365 days!!!
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_us.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_us.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,155 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_J;
+
+public final class Time_us extends AbstractTime
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "s" );
+ m_UnitName = ( "microsecond" );
+ }
+
+ public Time_us( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Time_us(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Time add( Time time )
+ {
+ return new Time_us( value + time.to_us().doubleValue() );
+ }
+
+ public Time subtract( Time time )
+ {
+ return new Time_us( value - time.to_us().doubleValue() );
+ }
+
+ public Ratio divide( Time time )
+ {
+ return new Ratio_abs( this.value / time.to_us().doubleValue() );
+ }
+
+ public Time divide( Ratio ratio )
+ {
+ return new Time_us( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Time multiply( Ratio ratio )
+ {
+ return new Time_us( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Power power )
+ {
+ return new Energy_J( to_s().doubleValue() *
power.to_W().doubleValue() );
+ }
+
+ public Time to_ps()
+ {
+ return new Time_ps( value * 1000000.0 );
+ }
+
+ public Time to_ns()
+ {
+ return new Time_ns( value * 1000.0);
+ }
+
+ public Time to_us()
+ {
+ return new Time_us( value );
+ }
+
+ public Time to_ms()
+ {
+ return new Time_ms( value / 1000.0 );
+ }
+
+ public Time to_s()
+ {
+ return new Time_s(value / 1000000.0);
+ }
+
+ public Time to_m()
+ {
+ return new Time_m(value / 60000000.0);
+ }
+
+ public Time to_h()
+ {
+ return new Time_h(value / 3600000000.0);
+ }
+
+ public Time to_d()
+ {
+ return new Time_d(value / 86400000000.0 );
+ }
+
+ public Time to_w()
+ {
+ return new Time_w(value / 604800000000.0 );
+ }
+
+ public Time to_y()
+ {
+ return new Time_y(value / 31536000000000.0); // 365 days!!!
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_w.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_w.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,156 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_kWh;
+
+public final class Time_w extends AbstractTime
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "w" );
+ m_UnitName = ( "week" );
+ }
+
+ public Time_w( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Time_w(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Time add( Time time )
+ {
+ return new Time_w( value + time.to_w().doubleValue() );
+ }
+
+ public Time subtract( Time time )
+ {
+ return new Time_w( value - time.to_w().doubleValue() );
+ }
+
+ public Ratio divide( Time time )
+ {
+ return new Ratio_abs( this.value / time.to_w().doubleValue() );
+ }
+
+ public Time divide( Ratio ratio )
+ {
+ return new Time_w( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Time multiply( Ratio ratio )
+ {
+ return new Time_w( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Power power )
+ {
+ return new Energy_kWh( to_h().doubleValue() *
power.to_kW().doubleValue() );
+ }
+
+ public Time to_ps()
+ {
+ return new Time_ps(value*604800000000000000.0);
+ }
+
+ public Time to_ns()
+ {
+ return new Time_ns(value*604800000000000.0);
+ }
+
+ public Time to_us()
+ {
+ return new Time_us(value*604800000000.0);
+ }
+
+ public Time to_ms()
+ {
+ return new Time_ms(value*604800000.0);
+ }
+
+ public Time to_s()
+ {
+ return new Time_s(value*604800.0);
+ }
+
+ public Time to_m()
+ {
+ return new Time_m(value*10080.0);
+ }
+
+ public Time to_h()
+ {
+ return new Time_h(value*168.0);
+ }
+
+ public Time to_d()
+ {
+ return new Time_d(value*7.0);
+ }
+
+ public Time to_w()
+ {
+ return new Time_w(value);
+ }
+
+ public Time to_y()
+ {
+ return new Time_y(value/52.14285714286); // 365 days!!!
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_y.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/time/Time_y.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,156 @@
+/*
+ * 0.97 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.time;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.energy.Energy_kWh;
+
+public final class Time_y extends AbstractTime
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "y" );
+ m_UnitName = ( "year" );
+ }
+
+ public Time_y( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Time_y(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Time add( Time time )
+ {
+ return new Time_y( value + time.to_y().doubleValue() );
+ }
+
+ public Time subtract( Time time )
+ {
+ return new Time_y( value - time.to_y().doubleValue() );
+ }
+
+ public Ratio divide( Time time )
+ {
+ return new Ratio_abs( this.value / time.to_y().doubleValue() );
+ }
+
+ public Time divide( Ratio ratio )
+ {
+ return new Time_y( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Time multiply( Ratio ratio )
+ {
+ return new Time_y( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Energy multiply( Power power )
+ {
+ return new Energy_kWh( to_h().doubleValue() *
power.to_kW().doubleValue() );
+ }
+
+ public Time to_ps()
+ {
+ return new Time_ps(value*31536000000000000000.0);
+ }
+
+ public Time to_ns()
+ {
+ return new Time_ns(value*31536000000000000.0);
+ }
+
+ public Time to_us()
+ {
+ return new Time_us(value*31536000000000.0);
+ }
+
+ public Time to_ms()
+ {
+ return new Time_ms(value*31536000000.0);
+ }
+
+ public Time to_s()
+ {
+ return new Time_s(value*31536000.0);
+ }
+
+ public Time to_m()
+ {
+ return new Time_m(value*525600.0);
+ }
+
+ public Time to_h()
+ {
+ return new Time_h(value*8760.0);
+ }
+
+ public Time to_d()
+ {
+ return new Time_d(value*365.0);
+ }
+
+ public Time to_w()
+ {
+ return new Time_w(value*52.14285714286);
+ }
+
+ public Time to_y()
+ {
+ return new Time_y(value); // 365 days!!!
+ }
+
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/velocity/AbstractVelocity.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/velocity/AbstractVelocity.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,36 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.velocity;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public abstract class AbstractVelocity extends GenericMetric
+ implements Velocity
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractVelocity( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/velocity/Velocity_km_h.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/velocity/Velocity_km_h.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,109 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.velocity;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Velocity_km_h extends AbstractVelocity
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "km/h";
+ m_UnitName = "kilometer per hour";
+ }
+
+ public Velocity_km_h(double value)
+ {
+ super(value );
+ }
+
+ public Velocity subtract( Velocity velocity )
+ {
+ return new Velocity_km_h( this.value -
velocity.to_km_h().doubleValue() );
+ }
+
+ public Velocity add( Velocity velocity )
+ {
+ return new Velocity_km_h( this.value +
velocity.to_km_h().doubleValue() );
+ }
+
+ public Ratio divide( Velocity velocity )
+ {
+ return new Ratio_abs( this.value / velocity.to_km_h().doubleValue()
);
+ }
+
+ public Velocity divide( Ratio ratio )
+ {
+ return new Velocity_km_h( this.value / ratio.to_abs().doubleValue()
);
+ }
+
+ public Velocity multiply( Ratio ratio )
+ {
+ return new Velocity_km_h( this.value * ratio.to_abs().doubleValue()
);
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Velocity_km_h(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Velocity to_m_s()
+ {
+ return new Velocity_m_s( value / 3.6 );
+ }
+
+ public Velocity to_km_h()
+ {
+ return new Velocity_km_h( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/velocity/Velocity_m_s.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/velocity/Velocity_m_s.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,109 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.velocity;
+
+import net.dpml.metric.*;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Velocity_m_s extends AbstractVelocity
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit= "m/s";
+ m_UnitName = "meter per second";
+ }
+
+ public Velocity_m_s(double value)
+ {
+ super(value );
+ }
+
+ public Velocity subtract( Velocity velocity )
+ {
+ return new Velocity_m_s( this.value -
velocity.to_m_s().doubleValue() );
+ }
+
+ public Velocity add( Velocity velocity )
+ {
+ return new Velocity_m_s( this.value +
velocity.to_m_s().doubleValue() );
+ }
+
+ public Ratio divide( Velocity velocity )
+ {
+ return new Ratio_abs( this.value / velocity.to_m_s().doubleValue() );
+ }
+
+ public Velocity divide( Ratio ratio )
+ {
+ return new Velocity_m_s( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Velocity multiply( Ratio ratio )
+ {
+ return new Velocity_m_s( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Velocity_m_s(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Velocity to_m_s()
+ {
+ return new Velocity_m_s( value );
+ }
+
+ public Velocity to_km_h()
+ {
+ return new Velocity_km_h( value * 3.6 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/AbstractVoltage.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/AbstractVoltage.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,35 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.voltage;
+
+import net.dpml.metric.*;
+
+public abstract class AbstractVoltage extends GenericMetric
+ implements Voltage
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractVoltage( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_V.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_V.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,137 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.voltage;
+
+import net.dpml.metric.*;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Voltage_V extends AbstractVoltage
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "V" );
+ m_UnitName = ( "volt" );
+ }
+
+ public Voltage_V( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Voltage_V(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Voltage add( Voltage voltage )
+ {
+ return new Voltage_V( value + voltage.to_V().doubleValue() );
+ }
+
+ public Voltage subtract( Voltage voltage )
+ {
+ return new Voltage_V( value - voltage.to_V().doubleValue() );
+ }
+
+ public Ratio divide( Voltage voltage )
+ {
+ return new Ratio_abs( value / voltage.to_V().doubleValue() );
+ }
+
+ public Voltage divide( Ratio ratio )
+ {
+ return new Voltage_V( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Voltage multiply( Ratio ratio )
+ {
+ return new Voltage_V( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance divide( Current current )
+ {
+ return new Resistance_ohm( value / current.to_A().doubleValue() );
+ }
+
+ public Current divide( Resistance resistance )
+ {
+ return new Current_A( value / resistance.to_ohm().doubleValue() );
+ }
+
+ public Power multiply( Current current )
+ {
+ return new Power_W( value / current.to_A().doubleValue() );
+ }
+
+ public Voltage to_V()
+ {
+ return new Voltage_V( value );
+ }
+
+ public Voltage to_mV()
+ {
+ return new Voltage_V( value * 1000.0 );
+ }
+
+ public Voltage to_uV()
+ {
+ return new Voltage_V( value * 1000000.0 );
+ }
+
+ public Voltage to_kV()
+ {
+ return new Voltage_V( value / 1000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_kV.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_kV.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,137 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.voltage;
+
+import net.dpml.metric.*;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Voltage_kV extends AbstractVoltage
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "kV" );
+ m_UnitName = ( "kilovolt" );
+ }
+
+ public Voltage_kV( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Voltage_kV(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Voltage add( Voltage voltage )
+ {
+ return new Voltage_kV( value + voltage.to_kV().doubleValue() );
+ }
+
+ public Voltage subtract( Voltage voltage )
+ {
+ return new Voltage_kV( value - voltage.to_kV().doubleValue() );
+ }
+
+ public Ratio divide( Voltage voltage )
+ {
+ return new Ratio_abs( value / voltage.to_kV().doubleValue() );
+ }
+
+ public Voltage divide( Ratio ratio )
+ {
+ return new Voltage_kV( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Voltage multiply( Ratio ratio )
+ {
+ return new Voltage_kV( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance divide( Current current )
+ {
+ return new Resistance_ohm( value / current.to_A().doubleValue() );
+ }
+
+ public Current divide( Resistance resistance )
+ {
+ return new Current_A( value / resistance.to_ohm().doubleValue() );
+ }
+
+ public Power multiply( Current current )
+ {
+ return new Power_W( to_V().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Voltage to_V()
+ {
+ return new Voltage_V( value );
+ }
+
+ public Voltage to_mV()
+ {
+ return new Voltage_V( value * 1000.0 );
+ }
+
+ public Voltage to_uV()
+ {
+ return new Voltage_V( value * 1000000.0 );
+ }
+
+ public Voltage to_kV()
+ {
+ return new Voltage_V( value / 1000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_mV.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_mV.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,137 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.voltage;
+
+import net.dpml.metric.*;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Voltage_mV extends AbstractVoltage
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "mV" );
+ m_UnitName = ( "millivolt" );
+ }
+
+ public Voltage_mV( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Voltage_mV(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Voltage add( Voltage voltage )
+ {
+ return new Voltage_mV( value + voltage.to_mV().doubleValue() );
+ }
+
+ public Voltage subtract( Voltage voltage )
+ {
+ return new Voltage_mV( value - voltage.to_mV().doubleValue() );
+ }
+
+ public Ratio divide( Voltage voltage )
+ {
+ return new Ratio_abs( value / voltage.to_mV().doubleValue() );
+ }
+
+ public Voltage divide( Ratio ratio )
+ {
+ return new Voltage_mV( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Voltage multiply( Ratio ratio )
+ {
+ return new Voltage_mV( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance divide( Current current )
+ {
+ return new Resistance_ohm( to_V().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Resistance resistance )
+ {
+ return new Current_A( to_V().doubleValue() /
resistance.to_ohm().doubleValue() );
+ }
+
+ public Power multiply( Current current )
+ {
+ return new Power_W( to_V().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Voltage to_V()
+ {
+ return new Voltage_V( value / 1000.0 );
+ }
+
+ public Voltage to_mV()
+ {
+ return new Voltage_V( value );
+ }
+
+ public Voltage to_uV()
+ {
+ return new Voltage_V( value * 1000.0 );
+ }
+
+ public Voltage to_kV()
+ {
+ return new Voltage_V( value / 1000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_uV.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/voltage/Voltage_uV.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,137 @@
+/*
+ * 0.97 99/01/09 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.voltage;
+
+import net.dpml.metric.*;
+import net.dpml.metric.current.Current_A;
+import net.dpml.metric.resistance.Resistance_ohm;
+import net.dpml.metric.power.Power_W;
+import net.dpml.metric.ratio.Ratio_abs;
+
+public final class Voltage_uV extends AbstractVoltage
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "V" );
+ m_UnitName = ( "microvolt" );
+ }
+
+ public Voltage_uV( double value )
+ {
+ super( value );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Voltage_uV(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Voltage add( Voltage voltage )
+ {
+ return new Voltage_uV( value + voltage.to_uV().doubleValue() );
+ }
+
+ public Voltage subtract( Voltage voltage )
+ {
+ return new Voltage_uV( value - voltage.to_uV().doubleValue() );
+ }
+
+ public Ratio divide( Voltage voltage )
+ {
+ return new Ratio_abs( value / voltage.to_uV().doubleValue() );
+ }
+
+ public Voltage divide( Ratio ratio )
+ {
+ return new Voltage_uV( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Voltage multiply( Ratio ratio )
+ {
+ return new Voltage_uV( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Resistance divide( Current current )
+ {
+ return new Resistance_ohm( to_V().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Current divide( Resistance resistance )
+ {
+ return new Current_A( to_V().doubleValue() /
resistance.to_ohm().doubleValue() );
+ }
+
+ public Power multiply( Current current )
+ {
+ return new Power_W( to_V().doubleValue() /
current.to_A().doubleValue() );
+ }
+
+ public Voltage to_V()
+ {
+ return new Voltage_V( value / 1000000.0 );
+ }
+
+ public Voltage to_mV()
+ {
+ return new Voltage_V( value / 1000.0 );
+ }
+
+ public Voltage to_uV()
+ {
+ return new Voltage_V( value );
+ }
+
+ public Voltage to_kV()
+ {
+ return new Voltage_V( value / 1000000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/AbstractVolume.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/AbstractVolume.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,35 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.volume;
+
+import net.dpml.metric.*;
+
+public abstract class AbstractVolume extends GenericMetric
+ implements Volume
+{
+ static final long serialVersionUID = 1L;
+
+ public AbstractVolume( double value )
+ {
+ super( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_cl.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_cl.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,162 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.volume;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_cm;
+import net.dpml.metric.area.Area_cm2;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.flow.Flow_l_s;
+
+public final class Volume_cl extends AbstractVolume
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "cl" );
+ m_UnitName = ( "centiliter" );
+ }
+
+ public Volume_cl( double value )
+ {
+ super( value );
+ }
+
+ public Area divide( Distance distance )
+ {
+ return new Area_cm2( to_cm3().doubleValue() /
distance.to_cm().doubleValue() );
+ }
+
+ public Distance divide( Area area )
+ {
+ return new Distance_cm( to_cm3().doubleValue() /
area.to_cm2().doubleValue() );
+ }
+
+ public Volume add( Volume volume )
+ {
+ return new Volume_cl( value + volume.to_cl().doubleValue() );
+ }
+
+ public Volume subtract( Volume volume )
+ {
+ return new Volume_cl( value - volume.to_cl().doubleValue() );
+ }
+
+ public Ratio divide( Volume volume )
+ {
+ return new Ratio_abs( this.value / volume.to_cl().doubleValue() );
+ }
+
+ public Volume divide( Ratio ratio )
+ {
+ return new Volume_cl( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Ratio ratio )
+ {
+ return new Volume_cl( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Flow divide( Time time )
+ {
+ return new Flow_l_s( to_l().doubleValue() /
time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Volume_cl(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Volume to_m3()
+ {
+ return new Volume_m3( value / 100000.0 );
+ }
+
+ public Volume to_mm3()
+ {
+ return new Volume_mm3( value * 10000.0);
+ }
+
+ public Volume to_cm3()
+ {
+ return new Volume_cm3( value * 10.0 );
+ }
+
+ public Volume to_dm3()
+ {
+ return new Volume_dm3( value / 100.0 );
+ }
+
+ public Volume to_km3()
+ {
+ return new Volume_km3( value / 1000000000000.0 );
+ }
+
+ public Volume to_ml()
+ {
+ return new Volume_ml( value * 10.0 );
+ }
+
+ public Volume to_cl()
+ {
+ return new Volume_cl( value );
+ }
+
+ public Volume to_dl()
+ {
+ return new Volume_dl( value / 10.0);
+ }
+
+ public Volume to_l()
+ {
+ return new Volume_l( value / 100.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_cm3.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_cm3.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,162 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.volume;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_cm;
+import net.dpml.metric.area.Area_cm2;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.flow.Flow_l_s;
+
+public final class Volume_cm3 extends AbstractVolume
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "cm3" );
+ m_UnitName = ( "cubic-centimeter" );
+ }
+
+ public Volume_cm3( double value )
+ {
+ super( value );
+ }
+
+ public Area divide( Distance distance )
+ {
+ return new Area_cm2( value / distance.to_cm().doubleValue() );
+ }
+
+ public Distance divide( Area area )
+ {
+ return new Distance_cm( value / area.to_cm2().doubleValue() );
+ }
+
+ public Volume add( Volume volume )
+ {
+ return new Volume_cm3( value + volume.to_cm3().doubleValue() );
+ }
+
+ public Volume subtract( Volume volume )
+ {
+ return new Volume_cm3( value - volume.to_cm3().doubleValue() );
+ }
+
+ public Ratio divide( Volume volume )
+ {
+ return new Ratio_abs( this.value / volume.to_cm3().doubleValue() );
+ }
+
+ public Volume divide( Ratio ratio )
+ {
+ return new Volume_cm3( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Ratio ratio )
+ {
+ return new Volume_cm3( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Flow divide( Time time )
+ {
+ return new Flow_l_s( to_l().doubleValue() /
time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Volume_cm3(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Volume to_m3()
+ {
+ return new Volume_m3( value / 1000000.0 );
+ }
+
+ public Volume to_mm3()
+ {
+ return new Volume_mm3( value * 1000.0);
+ }
+
+ public Volume to_cm3()
+ {
+ return new Volume_cm3( value );
+ }
+
+ public Volume to_dm3()
+ {
+ return new Volume_dm3( value / 1000.0 );
+ }
+
+ public Volume to_km3()
+ {
+ return new Volume_km3( value / 1000000000000000.0 );
+ }
+
+ public Volume to_ml()
+ {
+ return new Volume_ml( value );
+ }
+
+ public Volume to_cl()
+ {
+ return new Volume_cl( value / 10.0 );
+ }
+
+ public Volume to_dl()
+ {
+ return new Volume_dl( value / 100.0);
+ }
+
+ public Volume to_l()
+ {
+ return new Volume_l( value / 1000.0);
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_dl.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_dl.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,162 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.volume;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_cm;
+import net.dpml.metric.area.Area_cm2;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.flow.Flow_l_s;
+
+public final class Volume_dl extends AbstractVolume
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "dl" );
+ m_UnitName = ( "deciliter" );
+ }
+
+ public Volume_dl( double value )
+ {
+ super( value );
+ }
+
+ public Area divide( Distance distance )
+ {
+ return new Area_cm2( to_cm3().doubleValue() /
distance.to_cm().doubleValue() );
+ }
+
+ public Distance divide( Area area )
+ {
+ return new Distance_cm( to_cm3().doubleValue() /
area.to_cm2().doubleValue() );
+ }
+
+ public Volume add( Volume volume )
+ {
+ return new Volume_dl( value + volume.to_dl().doubleValue() );
+ }
+
+ public Volume subtract( Volume volume )
+ {
+ return new Volume_dl( value - volume.to_dl().doubleValue() );
+ }
+
+ public Ratio divide( Volume volume )
+ {
+ return new Ratio_abs( this.value / volume.to_dl().doubleValue() );
+ }
+
+ public Volume divide( Ratio ratio )
+ {
+ return new Volume_dl( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Ratio ratio )
+ {
+ return new Volume_dl( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Flow divide( Time time )
+ {
+ return new Flow_l_s( to_l().doubleValue() /
time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Volume_dl(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Volume to_m3()
+ {
+ return new Volume_m3( value / 10000.0 );
+ }
+
+ public Volume to_mm3()
+ {
+ return new Volume_mm3( value * 100000.0);
+ }
+
+ public Volume to_cm3()
+ {
+ return new Volume_cm3( value * 100.0 );
+ }
+
+ public Volume to_dm3()
+ {
+ return new Volume_dm3( value / 10.0 );
+ }
+
+ public Volume to_km3()
+ {
+ return new Volume_km3( value / 100000000000.0 );
+ }
+
+ public Volume to_ml()
+ {
+ return new Volume_ml( value * 100.0 );
+ }
+
+ public Volume to_cl()
+ {
+ return new Volume_cl( value * 10.0 );
+ }
+
+ public Volume to_dl()
+ {
+ return new Volume_dl( value );
+ }
+
+ public Volume to_l()
+ {
+ return new Volume_l( value / 10.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_dm3.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_dm3.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,162 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.volume;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_dm;
+import net.dpml.metric.area.Area_dm2;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.flow.Flow_l_s;
+
+public final class Volume_dm3 extends AbstractVolume
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "dm3" );
+ m_UnitName = ( "cubic-decimeter" );
+ }
+
+ public Volume_dm3( double value )
+ {
+ super( value );
+ }
+
+ public Area divide( Distance distance )
+ {
+ return new Area_dm2( value / distance.to_dm().doubleValue() );
+ }
+
+ public Distance divide( Area area )
+ {
+ return new Distance_dm( value / area.to_dm2().doubleValue() );
+ }
+
+ public Volume add( Volume volume )
+ {
+ return new Volume_dm3( value + volume.to_dm3().doubleValue() );
+ }
+
+ public Volume subtract( Volume volume )
+ {
+ return new Volume_dm3( value - volume.to_dm3().doubleValue() );
+ }
+
+ public Ratio divide( Volume volume )
+ {
+ return new Ratio_abs( this.value / volume.to_dm3().doubleValue() );
+ }
+
+ public Volume divide( Ratio ratio )
+ {
+ return new Volume_dm3( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Ratio ratio )
+ {
+ return new Volume_dm3( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Flow divide( Time time )
+ {
+ return new Flow_l_s( to_l().doubleValue() /
time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Volume_dm3(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Volume to_m3()
+ {
+ return new Volume_m3( value / 1000.0 );
+ }
+
+ public Volume to_mm3()
+ {
+ return new Volume_mm3( value * 1000000.0);
+ }
+
+ public Volume to_cm3()
+ {
+ return new Volume_cm3( value * 1000.0 );
+ }
+
+ public Volume to_dm3()
+ {
+ return new Volume_dm3( value );
+ }
+
+ public Volume to_km3()
+ {
+ return new Volume_km3( value / 1000000000000.0 );
+ }
+
+ public Volume to_ml()
+ {
+ return new Volume_ml( value * 1000.0 );
+ }
+
+ public Volume to_cl()
+ {
+ return new Volume_cl( value * 100.0 );
+ }
+
+ public Volume to_dl()
+ {
+ return new Volume_dl( value * 10.0);
+ }
+
+ public Volume to_l()
+ {
+ return new Volume_l( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_km3.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_km3.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,162 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.volume;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_km;
+import net.dpml.metric.area.Area_km2;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.flow.Flow_m3_s;
+
+public final class Volume_km3 extends AbstractVolume
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "km3" );
+ m_UnitName = ( "cubic-kilometer" );
+ }
+
+ public Volume_km3( double value )
+ {
+ super( value );
+ }
+
+ public Area divide( Distance distance )
+ {
+ return new Area_km2( value / distance.to_km().doubleValue() );
+ }
+
+ public Distance divide( Area area )
+ {
+ return new Distance_km( value / area.to_km2().doubleValue() );
+ }
+
+ public Volume add( Volume volume )
+ {
+ return new Volume_km3( value + volume.to_km3().doubleValue() );
+ }
+
+ public Volume subtract( Volume volume )
+ {
+ return new Volume_km3( value - volume.to_km3().doubleValue() );
+ }
+
+ public Ratio divide( Volume volume )
+ {
+ return new Ratio_abs( this.value / volume.to_km3().doubleValue() );
+ }
+
+ public Volume divide( Ratio ratio )
+ {
+ return new Volume_km3( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Ratio ratio )
+ {
+ return new Volume_km3( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Flow divide( Time time )
+ {
+ return new Flow_m3_s( to_m3().doubleValue() /
time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Volume_km3(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Volume to_m3()
+ {
+ return new Volume_m3( value * 1000000000.0);
+ }
+
+ public Volume to_mm3()
+ {
+ return new Volume_mm3( value * 1000000000000000000.0);
+ }
+
+ public Volume to_cm3()
+ {
+ return new Volume_cm3( value * 1000000000000000.0);
+ }
+
+ public Volume to_dm3()
+ {
+ return new Volume_dm3( value * 1000000000000.0 );
+ }
+
+ public Volume to_km3()
+ {
+ return new Volume_km3( value );
+ }
+
+ public Volume to_ml()
+ {
+ return new Volume_ml( value * 1000000000000000.0 );
+ }
+
+ public Volume to_cl()
+ {
+ return new Volume_cl( value * 100000000000000.0 );
+ }
+
+ public Volume to_dl()
+ {
+ return new Volume_dl( value * 10000000000000.0);
+ }
+
+ public Volume to_l()
+ {
+ return new Volume_l( value * 1000000000000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_l.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_l.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,162 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.volume;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_dm;
+import net.dpml.metric.area.Area_dm2;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.flow.Flow_l_s;
+
+public final class Volume_l extends AbstractVolume
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "l" );
+ m_UnitName = ( "liter" );
+ }
+
+ public Volume_l( double value )
+ {
+ super( value );
+ }
+
+ public Area divide( Distance distance )
+ {
+ return new Area_dm2( value / distance.to_dm().doubleValue() );
+ }
+
+ public Distance divide( Area area )
+ {
+ return new Distance_dm( value / area.to_dm2().doubleValue() );
+ }
+
+ public Volume add( Volume volume )
+ {
+ return new Volume_l( value + volume.to_l().doubleValue() );
+ }
+
+ public Volume subtract( Volume volume )
+ {
+ return new Volume_l( value - volume.to_l().doubleValue() );
+ }
+
+ public Ratio divide( Volume volume )
+ {
+ return new Ratio_abs( this.value / volume.to_l().doubleValue() );
+ }
+
+ public Volume divide( Ratio ratio )
+ {
+ return new Volume_l( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Ratio ratio )
+ {
+ return new Volume_l( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Flow divide( Time time )
+ {
+ return new Flow_l_s( to_l().doubleValue() /
time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Volume_l(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Volume to_m3()
+ {
+ return new Volume_m3( value / 1000.0 );
+ }
+
+ public Volume to_mm3()
+ {
+ return new Volume_mm3( value * 1000000.0);
+ }
+
+ public Volume to_cm3()
+ {
+ return new Volume_cm3( value * 1000.0 );
+ }
+
+ public Volume to_dm3()
+ {
+ return new Volume_dm3( value );
+ }
+
+ public Volume to_km3()
+ {
+ return new Volume_km3( value / 1000000000000.0 );
+ }
+
+ public Volume to_ml()
+ {
+ return new Volume_ml( value * 1000.0 );
+ }
+
+ public Volume to_cl()
+ {
+ return new Volume_cl( value * 100.0 );
+ }
+
+ public Volume to_dl()
+ {
+ return new Volume_dl( value * 10.0);
+ }
+
+ public Volume to_l()
+ {
+ return new Volume_l( value );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_m3.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_m3.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,162 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.volume;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_m;
+import net.dpml.metric.area.Area_m2;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.flow.Flow_m3_s;
+
+public final class Volume_m3 extends AbstractVolume
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "m3" );
+ m_UnitName = ( "cubic-meter" );
+ }
+
+ public Volume_m3( double value )
+ {
+ super( value );
+ }
+
+ public Area divide( Distance distance )
+ {
+ return new Area_m2( value / distance.to_m().doubleValue() );
+ }
+
+ public Distance divide( Area area )
+ {
+ return new Distance_m( value / area.to_m2().doubleValue());
+ }
+
+ public Volume add( Volume volume )
+ {
+ return new Volume_m3( value + volume.to_m3().doubleValue() );
+ }
+
+ public Volume subtract( Volume volume )
+ {
+ return new Volume_m3( value - volume.to_m3().doubleValue() );
+ }
+
+ public Ratio divide( Volume volume )
+ {
+ return new Ratio_abs( this.value / volume.to_m3().doubleValue() );
+ }
+
+ public Volume divide( Ratio ratio )
+ {
+ return new Volume_m3( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Ratio ratio )
+ {
+ return new Volume_m3( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Flow divide( Time time )
+ {
+ return new Flow_m3_s( this.value / time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Volume_m3(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Volume to_m3()
+ {
+ return new Volume_m3( value );
+ }
+
+ public Volume to_mm3()
+ {
+ return new Volume_mm3( value * 1000000000.0);
+ }
+
+ public Volume to_cm3()
+ {
+ return new Volume_cm3( value * 1000000.0 );
+ }
+
+ public Volume to_dm3()
+ {
+ return new Volume_dm3( value * 1000.0 );
+ }
+
+ public Volume to_km3()
+ {
+ return new Volume_km3( value / 1000000000.0 );
+ }
+
+ public Volume to_ml()
+ {
+ return new Volume_ml( value * 1000000.0 );
+ }
+
+ public Volume to_cl()
+ {
+ return new Volume_cl( value * 100000.0 );
+ }
+
+ public Volume to_dl()
+ {
+ return new Volume_dl( value * 10000.0);
+ }
+
+ public Volume to_l()
+ {
+ return new Volume_l( value * 1000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_ml.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_ml.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,162 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.volume;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_cm;
+import net.dpml.metric.area.Area_cm2;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.flow.Flow_l_s;
+
+public final class Volume_ml extends AbstractVolume
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "ml" );
+ m_UnitName = ( "milliliter" );
+ }
+
+ public Volume_ml( double value )
+ {
+ super( value );
+ }
+
+ public Area divide( Distance distance )
+ {
+ return new Area_cm2( to_cm3().doubleValue() /
distance.to_cm().doubleValue() );
+ }
+
+ public Distance divide( Area area )
+ {
+ return new Distance_cm( to_cm3().doubleValue() /
area.to_cm2().doubleValue() );
+ }
+
+ public Volume add( Volume volume )
+ {
+ return new Volume_ml( value + volume.to_ml().doubleValue());
+ }
+
+ public Volume subtract( Volume volume )
+ {
+ return new Volume_ml( value - volume.to_ml().doubleValue() );
+ }
+
+ public Ratio divide( Volume volume )
+ {
+ return new Ratio_abs( this.value / volume.to_ml().doubleValue() );
+ }
+
+ public Volume divide( Ratio ratio )
+ {
+ return new Volume_ml( this.value / ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Ratio ratio )
+ {
+ return new Volume_ml( this.value * ratio.to_abs().doubleValue() );
+ }
+
+ public Flow divide( Time time )
+ {
+ return new Flow_l_s( to_l().doubleValue() /
time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Volume_ml(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Volume to_m3()
+ {
+ return new Volume_m3( value / 1000000.0 );
+ }
+
+ public Volume to_mm3()
+ {
+ return new Volume_mm3( value * 1000.0);
+ }
+
+ public Volume to_cm3()
+ {
+ return new Volume_cm3( value );
+ }
+
+ public Volume to_dm3()
+ {
+ return new Volume_dm3( value / 1000.0 );
+ }
+
+ public Volume to_km3()
+ {
+ return new Volume_km3( value / 10000000000000.0 );
+ }
+
+ public Volume to_ml()
+ {
+ return new Volume_ml( value );
+ }
+
+ public Volume to_cl()
+ {
+ return new Volume_cl( value / 10.0 );
+ }
+
+ public Volume to_dl()
+ {
+ return new Volume_dl( value / 100.0);
+ }
+
+ public Volume to_l()
+ {
+ return new Volume_l( value / 1000.0 );
+ }
+}
Added:
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_mm3.java
==============================================================================
--- (empty file)
+++
development/laboratory/planet/metric/src/main/net/dpml/metric/volume/Volume_mm3.java
Mon Jan 10 18:36:32 2005
@@ -0,0 +1,162 @@
+/*
+ * 0.90 98/08/25 Niclas Hedhman Initial Implementation
+ * 1.0 1999/07/30 Niclas Hedhman First Public Release
+ *
+ * Copyright (c) 1996-1999 Bali Automation. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for NON-COMMERCIAL purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies. Please refer to the file "copyright.html"
+ * for further important copyright and licensing information.
+ *
+ * BALI AUTOMATION MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
+ * SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. BALI AUTOMATION
+ * SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+ * RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS
+ * DERIVATIVES.
+ */
+
+package net.dpml.metric.volume;
+
+import net.dpml.metric.*;
+import net.dpml.metric.distance.Distance_mm;
+import net.dpml.metric.area.Area_mm2;
+import net.dpml.metric.ratio.Ratio_abs;
+import net.dpml.metric.flow.Flow_l_s;
+
+public final class Volume_mm3 extends AbstractVolume
+{
+ static final long serialVersionUID = 1L;
+
+ private static final String m_Unit;
+ private static final String m_UnitName;
+
+ static
+ {
+ m_Unit = ( "mm3" );
+ m_UnitName = ( "cubic-millimeter" );
+ }
+
+ public Volume_mm3( double value )
+ {
+ super( value );
+ }
+
+ public Area divide( Distance distance )
+ {
+ return new Area_mm2( value / distance.to_mm().doubleValue() );
+ }
+
+ public Distance divide( Area area )
+ {
+ return new Distance_mm( value / area.to_mm2().doubleValue() );
+ }
+
+ public Volume add( Volume volume )
+ {
+ return new Volume_mm3( value + volume.to_mm3().doubleValue() );
+ }
+
+ public Volume subtract( Volume volume )
+ {
+ return new Volume_mm3( value - volume.to_mm3().doubleValue() );
+ }
+
+ public Ratio divide( Volume volume )
+ {
+ return new Ratio_abs( value / volume.to_mm3().doubleValue() );
+ }
+
+ public Volume divide( Ratio ratio )
+ {
+ return new Volume_mm3( value / ratio.to_abs().doubleValue() );
+ }
+
+ public Volume multiply( Ratio ratio )
+ {
+ return new Volume_mm3( value * ratio.to_abs().doubleValue() );
+ }
+
+ public Flow divide( Time time )
+ {
+ return new Flow_l_s( to_l().doubleValue() /
time.to_s().doubleValue() );
+ }
+
+ public Metric create( double newvalue )
+ {
+ return new Volume_mm3(newvalue);
+ }
+
+ public String getUnit()
+ {
+ return m_Unit;
+ }
+
+ public String getUnitName()
+ {
+ return m_UnitName;
+ }
+
+ public String getMetricName()
+ {
+ return m_MetricName;
+ }
+
+ public String[] getMetricFormulas()
+ {
+ return m_MetricFormulas;
+ }
+
+ public String getMetricAbbrev()
+ {
+ return m_MetricAbbrev;
+ }
+
+ public Volume to_m3()
+ {
+ return new Volume_m3( value / 1000000000.0 );
+ }
+
+ public Volume to_mm3()
+ {
+ return new Volume_mm3( value );
+ }
+
+ public Volume to_cm3()
+ {
+ return new Volume_cm3( value / 1000.0);
+ }
+
+ public Volume to_dm3()
+ {
+ return new Volume_dm3( value / 1000000.0 );
+ }
+
+ public Volume to_km3()
+ {
+ return new Volume_km3( value / 1000000000000000000.0 );
+ }
+
+ public Volume to_ml()
+ {
+ return new Volume_ml( value / 1000.0);
+ }
+
+ public Volume to_cl()
+ {
+ return new Volume_cl( value / 10000.0 );
+ }
+
+ public Volume to_dl()
+ {
+ return new Volume_dl( value / 100000.0);
+ }
+
+ public Volume to_l()
+ {
+ return new Volume_l( value / 1000000.0);
+ }
+}
- svn commit: r1445 - in development/laboratory/planet/metric: . src src/main src/main/net src/main/net/dpml src/main/net/dpml/metric src/main/net/dpml/metric/acceleration src/main/net/dpml/metric/area src/main/net/dpml/metric/current src/main/net/dpml/metric/density src/main/net/dpml/metric/distance src/main/net/dpml/metric/energy src/main/net/dpml/metric/flow src/main/net/dpml/metric/force src/main/net/dpml/metric/gravity src/main/net/dpml/metric/mass src/main/net/dpml/metric/power src/main/net/dpml/metric/power/sub src/main/net/dpml/metric/pressure src/main/net/dpml/metric/ratio src/main/net/dpml/metric/resistance src/main/net/dpml/metric/temperature src/main/net/dpml/metric/time src/main/net/dpml/metric/velocity src/main/net/dpml/metric/voltage src/main/net/dpml/metric/volume, niclas, 01/10/2005
Archive powered by MHonArc 2.6.24.