|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
Measurable<Q extends Quantity> | This interface represents the measurable, countable, or comparable property or aspect of a thing. |
Class Summary | |
---|---|
DecimalMeasure<Q extends Quantity> | This class represents a measure whose value is an arbitrary-precision decimal number. |
Measure<V,Q extends Quantity> | This class represents the result of a measurement stated in a known unit. |
MeasureFormat | This class provides the interface for formatting and parsing measures . |
VectorMeasure<Q extends Quantity> | This class represents a measurement vector of two or more dimensions. |
Provides strongly typed measurements to enforce compile-time check of parameters consistency and avoid interface errors.
Let's take the following example:[code]
class Person {
void setWeight(double weight);
}[/code]
Should the weight be in pound, kilogram ??
Using measures there is no room for error:[code]
class Person {
void setWeight(Measurable
Users may create their own Measurable
implementation:[code]
public class Period implements Measurable
Users may also combine a definite amount (a number)
with a unit and make it a Measure
(and
a Measurable
instance).[code]
person.setWeight(Measure.valueOf(180.0, POUND)); // Measure
Measures may be formatted (or parsed) using either the
standard
unit format
(UCUM based) or a locale sensitive
format.[code]
// Standard format (UCUM). It is used by Measure.valueOf(...) and Measure.toString()
// This format is not locale-sensitive and can be used for unambiguous
// electronic communication of quantities together with their units without loss of information.
Measure
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV PACKAGE
NEXT PACKAGE
FRAMES
NO FRAMES
Copyright © 2010. All Rights Reserved.