KickJava   Java API By Example, From Geeks To Geeks.

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


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 static org.jscience.physics.units.SI.*;
12 import org.jscience.physics.units.Unit;
13
14 /**
15  * This class represents the rate of change of velocity with respect to time.
16  * The system unit for this quantity is "m/s²".
17  *
18  * @author <a HREF="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
19  * @version 2.0, June 16, 2005
20  */

21 public class Acceleration extends Quantity {
22
23     /**
24      * Holds the acceleration unit.
25      */

26     private final static Unit<Acceleration> UNIT = METER.divide(SECOND.pow(2));
27
28     /**
29      * Holds the factory for this class.
30      */

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

41     public final static Acceleration ZERO = Quantity.valueOf(0, UNIT);
42
43     /**
44      * Holds the standard acceleration of gravity (exact).
45      */

46     public final static Acceleration GRAVITY = Quantity.valueOf(9.80665, UNIT);
47
48     /**
49      * Default constructor (allows for derivation).
50      */

51     protected Acceleration() {
52     }
53
54     /**
55      * Shows {@link Acceleration} instances in the specified unit.
56      *
57      * @param unit the display unit for {@link Acceleration} instances.
58      */

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