KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jscience > physics > quantities > VolumetricDensity


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

9 package org.jscience.physics.quantities;
10
11 import org.jscience.physics.units.SI;
12 import org.jscience.physics.units.Unit;
13
14 /**
15  * This class represents a mass per unit volume of a substance under
16  * specified conditions of pressure and temperature. The system unit for
17  * this quantity is "kg/m³".
18  *
19  * @author <a HREF="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
20  * @version 1.0, October 24, 2004
21  */

22 public class VolumetricDensity extends Quantity {
23
24     /**
25      * Holds the associated unit.
26      */

27     private final static Unit<VolumetricDensity> UNIT = SI.KILOGRAM
28             .divide(SI.METER.pow(3));
29
30     /**
31      * Holds the factory for this class.
32      */

33     private final static Factory<VolumetricDensity> FACTORY = new Factory<VolumetricDensity>(
34             UNIT) {
35         protected VolumetricDensity create() {
36             return new VolumetricDensity();
37         }
38     };
39
40     /**
41      * Represents a {@link VolumetricDensity} amounting to nothing.
42      */

43     public final static VolumetricDensity ZERO = Quantity.valueOf(0, UNIT);
44
45     /**
46      * Default constructor (allows for derivation).
47      */

48     protected VolumetricDensity() {
49     }
50
51     /**
52      * Shows {@link VolumetricDensity} instances in the specified unit.
53      *
54      * @param unit the display unit for {@link VolumetricDensity} instances.
55      */

56     public static void showAs(Unit unit) {
57         QuantityFormat.show(VolumetricDensity.class, unit);
58     }
59
60     private static final long serialVersionUID = 1L;
61 }
62
Popular Tags