KickJava   Java API By Example, From Geeks To Geeks.

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


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 quantity that tends to produce an acceleration
16  * of a body in the direction of its application. The system unit for
17  * this quantity is "m·kg/s²". By default, instances of this class are showed
18  * in Newton ("N").
19  *
20  * @author <a HREF="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
21  * @version 1.0, October 24, 2004
22  */

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

28     private final static Unit<Force> UNIT = SI.NEWTON;
29
30     /**
31      * Holds the factory for this class.
32      */

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

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

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

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