javax.measure.unit

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » jscience 4.3.1 » javax.measure.unit 
javax.measure.unit

Provides support for programatic unit handling.

Standart/NonStandard Units

Standard units and prefixes are provided by the {@link javax.measure.unit.SI SI} class (Système International d'Unités) and about 50 non-standard units are available through the {@link javax.measure.unit.NonSI NonSI} class.

Usage examples:

[code] import javax.measure.Scalar; import javax.measure.Measure; import javax.measure.unit.*; import javax.measure.quantity.*; import static javax.measure.unit.SI.*; import static javax.measure.unit.NonSI.*; import static javax.measure.unit.Dimension.*; public class Main { public void main(String[] args) { // Conversion between units. System.out.println(KILO(METRE).getConverterTo(MILE).convert(10)); // Retrieval of the system unit (identifies the measurement type). System.out.println(REVOLUTION.divide(MINUTE).getSystemUnit()); // Dimension checking (allows/disallows conversions) System.out.println(ELECTRON_VOLT.isCompatible(WATT.times(HOUR))); // Retrieval of the unit dimension (depends upon the current model). System.out.println(ELECTRON_VOLT.getDimension()); } } > 6.2137119223733395 > rad/s > true > [L]²·[M]/[T]² [/code]

Unit Parameterization

Units are parameterized (<Q extends {@link javax.measure.quantity.Quantity Quantity}>) to enforce compile-time checks of units/measures consistency, for example:[code] Unit MINUTE = SECONDS.times(60); // Ok. Unit MINUTE = METRE.times(60); // Compile error. Unit HECTOPASCAL = HECTO(PASCAL); // Ok. Unit HECTOPASCAL = HECTO(NEWTON); // Compile error. Measurable duration = Measure.valueOf(2, MINUTE); // Ok. Measurable duration = Measure.valueOf(2, CELSIUS); // Compile error. long milliseconds = duration.longValue(MILLI(SECOND)); // Ok. long milliseconds = duration.longValue(POUND); // Compile error. [/code]

UML Diagram

UML Diagram
Java Source File NameTypeComment
AlternateUnit.javaClass
BaseUnit.javaClass

This class represents the building blocks on top of which all others units are created.

CompoundUnit.javaClass

This class represents the multi-radix units (such as "hour:min:sec").

DerivedUnit.javaClass
Dimension.javaClass

This class represents the dimension of an unit.

NonSI.javaClass
ProductUnit.javaClass

This class represents units formed by the product of rational powers of existing units.

This class maintains the canonical form of this product (simplest form after factorization).

SI.javaClass

This class contains SI (Système International d'Unités) base units, and derived units.

It also defines the 20 SI prefixes used to form decimal multiples and submultiples of SI units.

SystemOfUnits.javaClass

This class represents a system of units, it groups units together for historical or cultural reasons.

TransformedUnit.javaClass

This class represents the units derived from other units using UnitConverter converters .

Examples of transformed units:[code] CELSIUS = KELVIN.add(273.15); FOOT = METER.multiply(0.3048); MILLISECOND = MILLI(SECOND); [/code]

Transformed units have no label.

Unit.javaClass

This class represents a determinate javax.measure.quantity.Quantityquantity (as of length, time, heat, or value) adopted as a standard of measurement.

It is helpful to think of instances of this class as recording the history by which they are created.

UnitFormat.javaClass

This class provides the interface for formatting and parsing Unit units .

For all SI units, the 20 SI prefixes used to form decimal multiples and sub-multiples of SI units are recognized. NonSI units are directly recognized.

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.