|
JScience v3.3 | ||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||
See:
Description
| Interface Summary | |
|---|---|
| Acceleration | This interface represents the rate of change of velocity with respect to time. |
| AmountOfSubstance | This interface represents the number of elementary entities (molecules, for example) of a substance. |
| Angle | This interface represents the figure formed by two lines diverging from a common point. |
| AngularAcceleration | This interface represents the rate of change of angular velocity with respect to time. |
| AngularVelocity | This interface represents the rate of change of angular displacement with respect to time. |
| Area | This interface represents the extent of a planar region or of the surface of a solid measured in square units. |
| CatalyticActivity | This interface represents a catalytic activity. |
| DataAmount | This interface represents a measure of data amount. |
| DataRate | This interface represents the speed of data-transmission. |
| Dimensionless | This interface represents a dimensionless quantity. |
| Duration | This interface represents a period of existence or persistence. |
| DynamicViscosity | This interface represents the dynamic viscosity. |
| ElectricCapacitance | This interface represents an electric capacitance. |
| ElectricCharge | This interface represents an electric charge. |
| ElectricConductance | This interface represents an electric conductance. |
| ElectricCurrent | This interface represents the amount of electric charge flowing past a specified circuit point per unit time. |
| ElectricInductance | This interface represents an electric inductance. |
| ElectricPotential | This interface represents an electric potential or electromotive force. |
| ElectricResistance | This interface represents an electric resistance. |
| Energy | This interface represents the capacity of a physical system to do work. |
| Force | This interface represents a quantity that tends to produce an acceleration of a body in the direction of its application. |
| Frequency | This interface represents the number of times a specified phenomenon occurs within a specified interval. |
| Illuminance | This interface represents an illuminance. |
| KinematicViscosity | This interface represents the diffusion of momentum. |
| Length | This interface represents the extent of something along its greatest dimension or the extent of space between two objects or places. |
| LuminousFlux | This interface represents a luminous flux. |
| LuminousIntensity | This interface represents the luminous flux density per solid angle as measured in a given direction relative to the emitting source. |
| MagneticFlux | This interface represents a magnetic flux. |
| MagneticFluxDensity | This interface represents a magnetic flux density. |
| Mass | This interface represents the measure of the quantity of matter that a body or an object contains. |
| MassFlowRate | This interface represents the movement of mass per time. |
| Power | This interface represents the rate at which work is done. |
| Pressure | This interface represents a force applied uniformly over a surface. |
| Quantity<Q extends Quantity> | This interface represents the measurable, countable, or comparable property or aspect of a thing. |
| RadiationDoseAbsorbed | This interface represents the amount of energy deposited per unit of mass. |
| RadiationDoseEffective | This interface represents the effective (or "equivalent") dose of radiation received by a human or some other living organism. |
| RadioactiveActivity | This interface represents a radioactive activity. |
| SolidAngle | This interface represents the angle formed by three or more planes intersecting at a common point. |
| Temperature | This class represents the degree of hotness or coldness of a body or an environment. |
| Torque | This interface represents the moment of a force. |
| Velocity | This interface represents a distance traveled divided by the time of travel. |
| Volume | This interface represents the amount of space occupied by a three-dimensional object or region of space, expressed in cubic units. |
| VolumetricDensity | This interface represents a mass per unit volume of a substance under specified conditions of pressure and temperature. |
| VolumetricFlowRate | This interface represents the volume of fluid passing a point in a system per unit of time. |
| Class Summary | |
|---|---|
| Scalar<Q extends Quantity> | This class represents a simple quantity implementation, that is completely specified by its magnitude and has no direction. |
Provides strongly typed quantities to enforce compile-time check of parameters consistency and avoid interface errors.
Let's take the following example:
Should the weight be in pound, kilogram ??
class Person {
void setWeight(double weight);
}
With quantities there is no room for error:
Not only the interface is cleaner (the weight has to be of mass type);
but also there is no confusion on the measurement unit:
class Person {
void setWeight(Quantity<Mass> weight);
}
Quantities work hand-in-hand with units (also parameterized).
For example, the following would result in compile-time error:
double weightInKg = weight.doubleValue(SI.KILOGRAM);
double weightInLb = weight.doubleValue(NonSI.POUND);
double weightInGal = weight.doubleValue(NonSI.GALLON); // Compile error, Unit<Mass> required.
This package provides only one basic quantity implementation (Scalar)
from which limitless simple immutable quantities objects can be created. Users may define more advanced quantity implementations
or simply use quantities interfaces to provide strong-typing to their own classes through parameterization.
For example:
// Concrete quantity implementation embedding measurement error.
public class Measure<Q extends Quantity> implements Quantity<Q> {
public Measure(double value, double error, Unit<Q> unit) { ... }
public double doubleValue(Unit<Q> unit) { ... } // Implements Quantity interface.
public long longValue(Unit<Q> unit) { ... } // Implements Quantity interface.
...
}
Measure<Volume> v = new Measure<Volume>(20, 0.1, LITER); // (20 ± 0.1) L
Measure<Frequency> f = new Measure<Frequency>(12.5, 0.05, GIGA(HERTZ)); // (12.5 ± 0.05) GHz
// Parameterized complex number.
public class Complex<Q extends Quantity> {
public Complex(double real, double imaginary, Unit<Q> unit) { ... }
...
}
Complex<ElectricCurrent> i = new Complex(2, -3, MICRO(AMPERE)); // (2 - 3i) µA
Complex<ElectricPotential> v = new Complex(12.3, 5.2, VOLT); // // (12.3 + 5.2i) V
// Parameterized vector.
public class Vector<Q extends Quantity> {
public Vector(Unit<Q> unit, double... elements) { ... }
...
}
Vector<Velocity> v1 = new Vector<Velocity>(KILO(METER_PER_SECOND), 1.2, 3.5, -6.5);
Vector<Angle> v2 = new Vector<Angle>(DEGREE_ANGLE, 34.5, 12.3);
|
JScience v3.3 | ||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | ||||||||