diff --git a/.gitignore b/.gitignore deleted file mode 100644 index afa3539..0000000 --- a/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -target/ -pom.xml.tag -pom.xml.releaseBackup -pom.xml.versionsBackup -pom.xml.next -release.properties -dependency-reduced-pom.xml -buildNumber.properties -.mvn/timing.properties -/.settings/ -/.classpath -/.project diff --git a/pom.xml b/pom.xml index a15dba4..0f419d9 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ https://kenai.com/projects/jsr-275 ======================================================================= --> - + Jean-Marie Dautelle * @author Werner Keil - * @version 1.0.3 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version 1.0.4 ($Revision: 96 $), $Date: 2010-02-03 19:21:17 +0100 (Mi, 03 Feb 2010) $ */ -public interface Measurable extends Comparable> { +interface Measurable extends Comparable> { /** * Returns the integral int value of this measurable when diff --git a/src/main/java/javax/measure/Measure.java b/src/main/java/javax/measure/Measure.java index 7f87bad..c71d74c 100644 --- a/src/main/java/javax/measure/Measure.java +++ b/src/main/java/javax/measure/Measure.java @@ -80,13 +80,12 @@ */ package javax.measure; -import java.io.Serializable; import java.math.BigDecimal; import java.math.MathContext; import java.text.ParsePosition; -import javax.measure.converter.UnitConverter; import javax.measure.quantity.Quantity; +import javax.measure.unit.UnitConverter; import javax.measure.unit.Unit; /** @@ -143,10 +142,9 @@ * * @author Jean-Marie Dautelle * @author Werner Keil - * @version 1.0.4 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version 1.1.2 ($Revision: 102 $), $Date: 2010-02-07 23:46:37 +0100 (So, 07 Feb 2010) $ */ -public abstract class Measure implements Measurable, - Serializable { +public abstract class Measure extends Number implements Measurable { /** * @@ -193,7 +191,7 @@ public long round(Unit unit) { * @throws ArithmeticException if the result is inexact and the quotient * has a non-terminating decimal expansion. */ - public Measure toSI() { + public Measure toSI() { // TODO needed? return to(this.getUnit().toSI()); } @@ -312,20 +310,32 @@ public int hashCode() { } /** - * Returns the String representation of this measure. The - * string produced for a given measure is always the same; it is not + * Returns the standard String representation of this measure. + * The string produced for a given measure is always the same; it is not * affected by locale. This means that it can be used as a canonical string * representation for exchanging measure, or as a key for a Hashtable, etc. * Locale-sensitive measure formatting and parsing is handled by the * {@link MeasureFormat} class and its subclasses. * - * @return UnitFormat.getInternational().format(this) + * @return UnitFormat.getStandard().format(this) */ @Override public String toString() { return MeasureFormat.getStandard().format(this); } + /** + * Returns the locale String representation of this measure + * (usually nicer looking than {@link #toString}. The + * string produced for a given measure is not always the same depending + * on the locale. + * + * @return UnitFormat.getInstance().format(this) + */ +// public String toStringLocale() { +// return MeasureFormat.getInstance().format(this); +// } + // Implements Measurable public final int intValue(Unit unit) throws ArithmeticException { long longValue = longValue(unit); @@ -343,12 +353,20 @@ public long longValue(Unit unit) throws ArithmeticException { } return (long) result; } + + public long longValue() { + return longValue(getUnit()); + } // Implements Measurable public final float floatValue(Unit unit) { return (float) doubleValue(unit); } + public final float floatValue() { + return floatValue(getUnit()); + } + /** * Casts this measure to a parameterized unit of specified nature or throw a * ClassCastException if the dimension of the specified @@ -369,7 +387,7 @@ public final float floatValue(Unit unit) { @SuppressWarnings("unchecked") public Measure asType(Class type) throws ClassCastException { - this.getUnit().asType(type); // Raises ClassCastException is dimension + this.getUnit().asType(type); // Raises ClassCastException if dimension // mismatches. return (Measure) this; } @@ -414,35 +432,35 @@ private static class IntegerMeasure extends Measure { */ private static final long serialVersionUID = 5355395476874521709L; - int _value; + int value; - Unit _unit; + Unit unit; public IntegerMeasure(int value, Unit unit) { - _value = value; - _unit = unit; + this.value = value; + this.unit = unit; } @Override public Integer getValue() { - return _value; + return value; } @Override public Unit getUnit() { - return _unit; + return unit; } // Implements Measurable public double doubleValue(Unit unit) { - return (_unit.equals(unit)) ? _value : _unit.getConverterTo(unit).convert(_value); + return (this.unit.equals(unit)) ? value : this.unit.getConverterTo(unit).convert(value); } // Implements Measurable public BigDecimal decimalValue(Unit unit, MathContext ctx) throws ArithmeticException { - BigDecimal decimal = BigDecimal.valueOf(_value); - return (_unit.equals(unit)) ? decimal : _unit.getConverterTo(unit).convert(decimal, ctx); + BigDecimal decimal = BigDecimal.valueOf(value); + return (this.unit.equals(unit)) ? decimal : this.unit.getConverterTo(unit).convert(decimal, ctx); } } @@ -646,7 +664,7 @@ public Unit getUnit() { return unit; } - // Implements Measurable + public double doubleValue(Unit unit) { return (this.unit.equals(unit)) ? value.doubleValue() : this.unit.getConverterTo(unit).convert(value.doubleValue()); } @@ -657,4 +675,14 @@ public BigDecimal decimalValue(Unit unit, MathContext ctx) return (this.unit.equals(unit)) ? value : this.unit.getConverterTo(unit).convert(value, ctx); } } + + @Override + public double doubleValue() { + return doubleValue(getUnit()); + } + + @Override + public int intValue() { + return intValue(getUnit()); + } } \ No newline at end of file diff --git a/src/main/java/javax/measure/MeasureFormat.java b/src/main/java/javax/measure/MeasureFormat.java index 256f931..300e920 100644 --- a/src/main/java/javax/measure/MeasureFormat.java +++ b/src/main/java/javax/measure/MeasureFormat.java @@ -102,7 +102,7 @@ * * @author Jean-Marie Dautelle * @author Werner Keil - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version 1.0.1 ($Revision: 89 $), $Date: 2010-01-31 23:15:22 +0100 (So, 31 Jän 2010) $ */ public abstract class MeasureFormat extends Format { @@ -348,7 +348,7 @@ public Appendable format(Measure measure, Appendable dest) if (measure.getUnit().equals(Unit.ONE)) return dest; dest.append(' '); - return UnitFormat.getStandard().format(unit, dest); + return UnitFormat.getInstance().format(unit, dest); } } @@ -369,7 +369,7 @@ public Measure parse(CharSequence csq, ParsePosition cursor) BigDecimal decimal = new BigDecimal(csq.subSequence(startDecimal, endDecimal).toString()); cursor.setIndex(endDecimal + 1); - Unit unit = UnitFormat.getStandard().parse(csq, cursor); + Unit unit = UnitFormat.getInstance().parse(csq, cursor); return Measure.valueOf(decimal, unit); } } diff --git a/src/main/java/javax/measure/converter/AddConverter.java b/src/main/java/javax/measure/converter/AddConverter.java deleted file mode 100644 index 2bbef8c..0000000 --- a/src/main/java/javax/measure/converter/AddConverter.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.converter; - -import java.math.BigDecimal; -import java.math.MathContext; - -/** - *

This class represents a converter adding a constant offset - * to numeric values (double based).

- * - *

Instances of this class are immutable.

- * - * @author Jean-Marie Dautelle - * @author Werner Keil - * - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public final class AddConverter extends UnitConverter { - - /** - * - */ - private static final long serialVersionUID = 8088797685241019815L; - /** - * Holds the offset. - */ - private final double offset; - - /** - * Creates an add converter with the specified offset. - * - * @param offset the offset value. - * @throws IllegalArgumentException if offset is 0.0 - * (would result in identity converter). - */ - public AddConverter(double offset) { - if (offset == 0.0) { - throw new IllegalArgumentException("Would result in identity converter"); - } - this.offset = offset; - } - - /** - * Returns the offset value for this add converter. - * - * @return the offset value. - */ - public double getOffset() { - return offset; - } - - @Override - public UnitConverter concatenate(UnitConverter converter) { - if (converter instanceof AddConverter) { - double newOffset = offset + ((AddConverter) converter).offset; - return newOffset == 0.0 ? IDENTITY : new AddConverter(newOffset); - } else { - return super.concatenate(converter); - } - } - - @Override - public AddConverter inverse() { - return new AddConverter(-offset); - } - - @Override - public double convert(double value) { - return value + offset; - } - - @Override - public BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException { - return value.add(BigDecimal.valueOf(offset), ctx); - } - - @Override - public final String toString() { - return "AddConverter(" + offset + ")"; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof AddConverter)) { - return false; - } - AddConverter that = (AddConverter) obj; - return this.offset == that.offset; - } - - @Override - public int hashCode() { - long bits = Double.doubleToLongBits(offset); - return (int) (bits ^ (bits >>> 32)); - } -} \ No newline at end of file diff --git a/src/main/java/javax/measure/converter/ConversionException.java b/src/main/java/javax/measure/converter/ConversionException.java deleted file mode 100644 index 1bf40c8..0000000 --- a/src/main/java/javax/measure/converter/ConversionException.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.converter; - -/** - * Signals that a problem of some sort has occurred either when creating a - * converter between two units or during the conversion itself. - * - * @author Jean-Marie Dautelle - * @author Werner Keil - * @version 0.9.3 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public class ConversionException extends Exception { - - /** - * - */ - private static final long serialVersionUID = -2846245619420930853L; - - /** - * Constructs a ConversionException with no detail message. - */ - public ConversionException() { - super(); - } - - /** - * Constructs a ConversionException with the specified detail - * message. - * - * @param message the detail message. - */ - public ConversionException(String message) { - super(message); - } - - /** - * Constructs a ConversionException with the specified detail - * message and cause. - * - * @param message the detail message. - * @param cause the cause of the exception. - */ - public ConversionException(String message, Throwable cause) { - super(message, cause); - } - - /** - * Constructs a ConversionException with the cause. - * - * @param cause the cause of the exception. - */ - public ConversionException(Throwable cause) { - super(cause); - } -} \ No newline at end of file diff --git a/src/main/java/javax/measure/converter/ExpConverter.java b/src/main/java/javax/measure/converter/ExpConverter.java deleted file mode 100644 index dae8b9b..0000000 --- a/src/main/java/javax/measure/converter/ExpConverter.java +++ /dev/null @@ -1,167 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.converter; - -import java.math.BigDecimal; -import java.math.MathContext; - -/** - *

This class represents a exponential converter of limited precision. - * Such converter is typically used to create inverse of logarithmic unit. - * - *

Instances of this class are immutable.

- * - * @author Jean-Marie Dautelle - * @author Werner Keil - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public final class ExpConverter extends UnitConverter { - - /** - * - */ - private static final long serialVersionUID = -1862583888012861945L; - - /** - * Holds the logarithmic base. - */ - private final double base; - - /** - * Holds the natural logarithm of the base. - */ - private final double logOfBase; - - /** - * Creates a logarithmic converter having the specified base. - * - * @param base the logarithmic base (e.g. Math.E for - * the Natural Logarithm). - */ - public ExpConverter(double base) { - this.base = base; - this.logOfBase = Math.log(base); - } - - /** - * Returns the exponential base of this converter. - * - * @return the exponential base (e.g. Math.E for - * the Natural Exponential). - */ - public double getBase() { - return base; - } - - @Override - public UnitConverter inverse() { - return new LogConverter(base); - } - - @Override - public final String toString() { - return "ExpConverter("+ base + ")"; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof ExpConverter)) - return false; - ExpConverter that = (ExpConverter) obj; - return this.base == that.base; - } - - @Override - public int hashCode() { - long bits = Double.doubleToLongBits(base); - return (int) (bits ^ (bits >>> 32)); - } - - @Override - public double convert(double amount) { - return Math.exp(logOfBase * amount); - } - - @Override - public BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException { - return BigDecimal.valueOf(convert(value.doubleValue())); // Reverts to double conversion. - } -} diff --git a/src/main/java/javax/measure/converter/LinearConverter.java b/src/main/java/javax/measure/converter/LinearConverter.java deleted file mode 100644 index 76835e9..0000000 --- a/src/main/java/javax/measure/converter/LinearConverter.java +++ /dev/null @@ -1,186 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.converter; - -import java.math.BigDecimal; -import java.math.MathContext; - -/** - *

This class represents a linear converter. A converter is linear if - * convert(u + v) == convert(u) + convert(v) and - * convert(r * u) == r * convert(u). For linear converters the - * following property always hold:[code] - * y1 = c1.convert(x1); - * y2 = c2.convert(x2); - * // then y1*y2 == c1.concatenate(c2).convert(x1*x2) - * [/code]

- * - *

{@link LinearConverter#concatenate Concatenation} of linear converters - * always result into a linear converter.

- * - * @author Jean-Marie Dautelle - * @author Werner Keil - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public abstract class LinearConverter extends UnitConverter { - - /** - * - */ - private static final long serialVersionUID = 6162554778940577274L; - - @Override - public UnitConverter concatenate(UnitConverter converter) { - if (converter == IDENTITY) - return this; - if (!(converter instanceof LinearConverter)) - return super.concatenate(converter); // Compound non-linear - // converter. - return new CompoundLinear(this, (LinearConverter) converter); - } - - @Override - public abstract LinearConverter inverse(); // Inverse of a linear converter - // should be linear. - - /** - * This inner class represents a compound linear converter. - */ - private static class CompoundLinear extends LinearConverter { - - /** - * - */ - private static final long serialVersionUID = -216541324424381418L; - - /** - * Holds the first converter. - */ - private final LinearConverter firstConverter; - /** - * Holds the second converter. - */ - private final LinearConverter secondConverter; - - /** - * Creates a compound linear converter resulting from the combined - * transformation of the specified converters. - * - * @param first the first converter. - * @param second the second converter. - */ - private CompoundLinear(LinearConverter first, LinearConverter second) { - this.firstConverter = first; - this.secondConverter = second; - } - - @Override - public LinearConverter inverse() { - return new CompoundLinear(secondConverter.inverse(), firstConverter.inverse()); - } - - @Override - public double convert(double value) { - return secondConverter.convert(firstConverter.convert(value)); - } - - @Override - public BigDecimal convert(BigDecimal value, MathContext ctx) { - return secondConverter.convert(firstConverter.convert(value, ctx), ctx); - } - - @Override - public boolean equals(Object cvtr) { - if (this == cvtr) - return true; - if (!(cvtr instanceof CompoundLinear)) - return false; - CompoundLinear that = (CompoundLinear) cvtr; - return (this.firstConverter.equals(that.firstConverter)) - && (this.secondConverter.equals(that.secondConverter)); - } - - @Override - public int hashCode() { - return firstConverter.hashCode() + secondConverter.hashCode(); - } - } -} \ No newline at end of file diff --git a/src/main/java/javax/measure/converter/LogConverter.java b/src/main/java/javax/measure/converter/LogConverter.java deleted file mode 100644 index 35e54c5..0000000 --- a/src/main/java/javax/measure/converter/LogConverter.java +++ /dev/null @@ -1,169 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.converter; - -import java.math.BigDecimal; -import java.math.MathContext; - -/** - *

This class represents a logarithmic converter of limited precision. - * Such converter is typically used to create logarithmic unit. - * For example:[code] - * Unit BEL = Unit.ONE.transform(new LogConverter(10).inverse()); - * [/code]

- * - *

Instances of this class are immutable.

- * - * @author Jean-Marie Dautelle - * @author Werner Keil - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public final class LogConverter extends UnitConverter { - - /** - * - */ - private static final long serialVersionUID = -5581266460675123322L; - - /** - * Holds the logarithmic base. - */ - private final double base; - /** - * Holds the natural logarithm of the base. - */ - private final double logOfBase; - - /** - * Creates a logarithmic converter having the specified base. - * - * @param base the logarithmic base (e.g. Math.E for - * the Natural Logarithm). - */ - public LogConverter(double base) { - this.base = base; - logOfBase = Math.log(base); - } - - /** - * Returns the logarithmic base of this converter. - * - * @return the logarithmic base (e.g. Math.E for - * the Natural Logarithm). - */ - public double getBase() { - return base; - } - - @Override - public UnitConverter inverse() { - return new ExpConverter(base); - } - - @Override - public final String toString() { - return "LogConverter("+ base + ")"; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof LogConverter)) - return false; - LogConverter that = (LogConverter) obj; - return this.base == that.base; - } - - @Override - public int hashCode() { - long bits = Double.doubleToLongBits(base); - return (int) (bits ^ (bits >>> 32)); - } - - @Override - public double convert(double amount) { - return Math.log(amount) / logOfBase; - } - - @Override - public BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException { - return BigDecimal.valueOf(convert(value.doubleValue())); // Reverts to double conversion. - } -} diff --git a/src/main/java/javax/measure/converter/MultiplyConverter.java b/src/main/java/javax/measure/converter/MultiplyConverter.java deleted file mode 100644 index 79008df..0000000 --- a/src/main/java/javax/measure/converter/MultiplyConverter.java +++ /dev/null @@ -1,171 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.converter; - -import java.math.BigDecimal; -import java.math.MathContext; - -/** - *

This class represents a converter multiplying numeric values by a - * constant scaling factor (double based).

- * - *

Instances of this class are immutable.

- * - * @author Jean-Marie Dautelle - * @author Werner Keil - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public final class MultiplyConverter extends LinearConverter { - - /** - * - */ - private static final long serialVersionUID = 6497743504427978825L; - /** - * Holds the scale factor. - */ - private final double factor; - - /** - * Creates a multiply converter with the specified scale factor. - * - * @param factor the scaling factor. - * @throws IllegalArgumentException if coefficient is 1.0 - * (would result in identity converter) - */ - public MultiplyConverter(double factor) { - if (factor == 1.0) - throw new IllegalArgumentException("Would result in identity converter"); - this.factor = factor; - } - - /** - * Returns the scale factor of this converter. - * - * @return the scale factor. - */ - public double getFactor() { - return factor; - } - - @Override - public UnitConverter concatenate(UnitConverter converter) { - if (converter instanceof MultiplyConverter) { - double newfactor = factor * ((MultiplyConverter) converter).factor; - return newfactor == 1.0 ? IDENTITY : new MultiplyConverter(newfactor); - } else - return super.concatenate(converter); - } - - @Override - public MultiplyConverter inverse() { - return new MultiplyConverter(1.0 / factor); - } - - @Override - public double convert(double value) { - return value * factor; - } - - @Override - public BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException { - return value.multiply(BigDecimal.valueOf(factor), ctx); - } - - @Override - public final String toString() { - return "MultiplyConverter("+ factor + ")"; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof MultiplyConverter)) - return false; - MultiplyConverter that = (MultiplyConverter) obj; - return this.factor == that.factor; - } - - @Override - public int hashCode() { - long bits = Double.doubleToLongBits(factor); - return (int)(bits ^ (bits >>> 32)); - } -} diff --git a/src/main/java/javax/measure/converter/RationalConverter.java b/src/main/java/javax/measure/converter/RationalConverter.java deleted file mode 100644 index db140fe..0000000 --- a/src/main/java/javax/measure/converter/RationalConverter.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.converter; - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.math.MathContext; - -/** - *

This class represents a converter multiplying numeric values by an - * exact scaling factor (represented as the quotient of two - * BigInteger numbers).

- * - *

Instances of this class are immutable.

- * - * @author Jean-Marie Dautelle - * @author Werner Keil - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public final class RationalConverter extends LinearConverter { - - /** - * - */ - private static final long serialVersionUID = 5313011404391445406L; - - /** - * Holds the converter dividend. - */ - private final BigInteger dividend; - /** - * Holds the converter divisor (always positive). - */ - private final BigInteger divisor; - - /** - * Creates a rational converter with the specified dividend and - * divisor. - * - * @param dividend the dividend. - * @param divisor the positive divisor. - * @throws IllegalArgumentException if divisor <= 0 - * @throws IllegalArgumentException if dividend == divisor - */ - public RationalConverter(BigInteger dividend, BigInteger divisor) { - if (divisor.compareTo(BigInteger.ZERO) <= 0) - throw new IllegalArgumentException("Negative or zero divisor"); - if (dividend.equals(divisor)) - throw new IllegalArgumentException("Would result in identity converter"); - this.dividend = dividend; // Exact conversion. - this.divisor = divisor; // Exact conversion. - } - - /** - * Returns the integer dividend for this rational converter. - * - * @return this converter dividend. - */ - public BigInteger getDividend() { - return dividend; - } - - /** - * Returns the integer (positive) divisor for this rational converter. - * - * @return this converter divisor. - */ - public BigInteger getDivisor() { - return divisor; - } - - @Override - public double convert(double value) { - return value * toDouble(dividend) / toDouble(divisor); - } - - // Optimization of BigInteger.doubleValue() (implementation too inneficient). - private static double toDouble(BigInteger integer) { - return (integer.bitLength() < 64) ? integer.longValue() : integer.doubleValue(); - } - - @Override - public BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException { - return value.multiply(new BigDecimal(dividend, ctx), ctx).divide(new BigDecimal(divisor, ctx), ctx); - } - - @Override - public UnitConverter concatenate(UnitConverter converter) { - if (converter instanceof RationalConverter) { - RationalConverter that = (RationalConverter) converter; - BigInteger dividend = this.getDividend().multiply(that.getDividend()); - BigInteger divisor = this.getDivisor().multiply(that.getDivisor()); - BigInteger gcd = dividend.gcd(divisor); - dividend = dividend.divide(gcd); - divisor = divisor.divide(gcd); - return (dividend.equals(BigInteger.ONE) && divisor.equals(BigInteger.ONE)) - ? IDENTITY : new RationalConverter(dividend, divisor); - } else - return super.concatenate(converter); - } - - @Override - public RationalConverter inverse() { - return dividend.signum() == -1 ? new RationalConverter(getDivisor().negate(), getDividend().negate()) - : new RationalConverter(getDivisor(), getDividend()); - } - - @Override - public final String toString() { - return "RationalConverter("+ dividend + "," + divisor + ")"; - } - - @Override - public boolean equals(Object obj) { - if (!(obj instanceof RationalConverter)) - return false; - RationalConverter that = (RationalConverter) obj; - return this.dividend.equals(that.dividend) && - this.divisor.equals(that.divisor); - } - - @Override - public int hashCode() { - return dividend.hashCode() + divisor.hashCode(); - } -} diff --git a/src/main/java/javax/measure/converter/UnitConverter.java b/src/main/java/javax/measure/converter/UnitConverter.java deleted file mode 100644 index 4d14766..0000000 --- a/src/main/java/javax/measure/converter/UnitConverter.java +++ /dev/null @@ -1,291 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.converter; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.math.MathContext; - -/** - *

This class represents a converter of numeric values.

- * - *

It is not required for sub-classes to be immutable - * (e.g. currency converter).

- * - *

Sub-classes must ensure unicity of the {@link #IDENTITY identity} - * converter. In other words, if the result of an operation is equivalent - * to the identity converter, then the unique {@link #IDENTITY} instance - * should be returned.

- * - * @author Jean-Marie Dautelle - * @version 1.0.1 ($Revison$), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public abstract class UnitConverter implements Serializable { - - /** - * - */ - private static final long serialVersionUID = 2557410026012911803L; - - /** - * Holds the identity converter (unique). This converter does nothing - * (ONE.convert(x) == x). This instance is unique. - * ( - */ - public static final UnitConverter IDENTITY = new Identity(); - - /** - * Default constructor. - */ - protected UnitConverter() { - } - - /** - * Returns the inverse of this converter. If x is a valid - * value, then x == inverse().convert(convert(x)) to within - * the accuracy of computer arithmetic. - * - * @return the inverse of this converter. - */ - public abstract UnitConverter inverse(); - - /** - * Converts a double value. - * - * @param value the numeric value to convert. - * @return the double value after conversion. - */ - public abstract double convert(double value); - - /** - * Converts a {@link BigDecimal} value. - * - * @param value the numeric value to convert. - * @param ctx the math context being used for conversion. - * @return the decimal value after conversion. - * @throws ArithmeticException if the result is inexact but the - * rounding mode is MathContext.UNNECESSARY or - * mathContext.precision == 0 and the quotient has a - * non-terminating decimal expansion. - */ - public abstract BigDecimal convert(BigDecimal value, MathContext ctx) throws ArithmeticException; - - /** - * Indicates whether this converter is considered to be the the same as the - * one specified. - * - * @param cvtr the converter with which to compare. - * @return true if the specified object is a converter - * considered equals to this converter;false otherwise. - */ - @Override - public abstract boolean equals(Object cvtr); - - /** - * Returns a hash code value for this converter. Equals object have equal - * hash codes. - * - * @return this converter hash code value. - * @see #equals - */ - @Override - public abstract int hashCode(); - - /** - * Concatenates this converter with another converter. The resulting - * converter is equivalent to first converting by the specified converter, - * and then converting by this converter. - * - *

Note: Implementations must ensure that the {@link #IDENTITY} instance - * is returned if the resulting converter is an identity - * converter.

- * - * @param converter the other converter. - * @return the concatenation of this converter with the other converter. - */ - public UnitConverter concatenate(UnitConverter converter) { - return (converter == IDENTITY) ? this : new Compound(converter, this); - } - - /** - * This inner class represents the identity converter (singleton). - */ - private static final class Identity extends LinearConverter { - - /** - * - */ - private static final long serialVersionUID = 7675901502919547460L; - - @Override - public Identity inverse() { - return this; - } - - @Override - public double convert(double value) { - return value; - } - - @Override - public BigDecimal convert(BigDecimal value, MathContext ctx) { - return value; - } - - @Override - public UnitConverter concatenate(UnitConverter converter) { - return converter; - } - - @Override - public boolean equals(Object cvtr) { - return this == cvtr; // Unique instance. - } - - @Override - public int hashCode() { - return 0; - } - } - - /** - * This inner class represents a compound converter (non-linear). - */ - private static final class Compound extends UnitConverter { - - /** - * - */ - private static final long serialVersionUID = 2242882007946934958L; - - /** - * Holds the first converter. - */ - private final UnitConverter first; - /** - * Holds the second converter. - */ - private final UnitConverter second; - - /** - * Creates a compound converter resulting from the combined - * transformation of the specified converters. - * - * @param first the first converter. - * @param second the second converter. - */ - private Compound(UnitConverter first, UnitConverter second) { - this.first = first; - this.second = second; - } - - @Override - public UnitConverter inverse() { - return new Compound(second.inverse(), first.inverse()); - } - - @Override - public double convert(double value) { - return second.convert(first.convert(value)); - } - - @Override - public BigDecimal convert(BigDecimal value, MathContext ctx) { - return second.convert(first.convert(value, ctx), ctx); - } - - @Override - public boolean equals(Object cvtr) { - if (this == cvtr) - return true; - if (!(cvtr instanceof Compound)) - return false; - Compound that = (Compound) cvtr; - return (this.first.equals(that.first)) && - (this.second.equals(that.second)); - } - - @Override - public int hashCode() { - return first.hashCode() + second.hashCode(); - } - } -} \ No newline at end of file diff --git a/src/main/java/javax/measure/converter/package-info.java b/src/main/java/javax/measure/converter/package-info.java deleted file mode 100644 index 2289a5c..0000000 --- a/src/main/java/javax/measure/converter/package-info.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/** - * Provides support for unit conversion. - * - *

UML Diagram

- * UML Diagram - * - * @author Jean-Marie Dautelle - * @version 1.0, April 15, 2009 - */ -package javax.measure.converter; diff --git a/src/main/java/javax/measure/quantity/Action.java b/src/main/java/javax/measure/quantity/Action.java index 2e89191..a887534 100644 --- a/src/main/java/javax/measure/quantity/Action.java +++ b/src/main/java/javax/measure/quantity/Action.java @@ -98,6 +98,6 @@ public interface Action extends Quantity { /** * Holds the SI unit (Système International d'Unités) for this quantity. */ - public final static Unit UNIT = new ProductUnit(SI.JOULE.times(SI.SECOND)); + public final static Unit UNIT = new ProductUnit(SI.JOULE.multiply(SI.SECOND)); } \ No newline at end of file diff --git a/src/main/java/javax/measure/quantity/DynamicViscosity.java b/src/main/java/javax/measure/quantity/DynamicViscosity.java index 7a683db..2acfab9 100644 --- a/src/main/java/javax/measure/quantity/DynamicViscosity.java +++ b/src/main/java/javax/measure/quantity/DynamicViscosity.java @@ -99,6 +99,6 @@ public interface DynamicViscosity extends Quantity { * Holds the SI unit (Système International d'Unités) for this quantity. */ public final static Unit UNIT - = new ProductUnit(SI.PASCAL.times(SI.SECOND)); + = new ProductUnit(SI.PASCAL.multiply(SI.SECOND)); } \ No newline at end of file diff --git a/src/main/java/javax/measure/quantity/Torque.java b/src/main/java/javax/measure/quantity/Torque.java index 9f74697..c8f44d8 100644 --- a/src/main/java/javax/measure/quantity/Torque.java +++ b/src/main/java/javax/measure/quantity/Torque.java @@ -101,6 +101,6 @@ public interface Torque extends Quantity { * Holds the SI unit (Système International d'Unités) for this quantity. */ public final static Unit UNIT = - new ProductUnit(SI.NEWTON.times(SI.METRE)); + new ProductUnit(SI.NEWTON.multiply(SI.METRE)); } diff --git a/src/main/java/javax/measure/unit/AlternateUnit.java b/src/main/java/javax/measure/unit/AlternateUnit.java index d43a0b2..d1b00c9 100644 --- a/src/main/java/javax/measure/unit/AlternateUnit.java +++ b/src/main/java/javax/measure/unit/AlternateUnit.java @@ -80,7 +80,6 @@ */ package javax.measure.unit; -import javax.measure.converter.UnitConverter; import javax.measure.quantity.Quantity; /** @@ -91,7 +90,7 @@ * {@link Unit#alternate(String)} method.

* * @author Jean-Marie Dautelle - * @version 1.0, April 15, 2009 + * @version 1.1, $Date: 2010-01-31 23:15:22 +0100 (So, 31 Jän 2010) $ */ public final class AlternateUnit extends DerivedUnit { @@ -182,5 +181,15 @@ public int hashCode() { return _symbol.hashCode(); } + @Override + public Dimension getDimension() { + return _parent.getDimension(); + } + + @Override + public UnitConverter getDimensionalTransform() { + return _parent.getDimensionalTransform(); + } + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/javax/measure/unit/AnnotatedUnit.java b/src/main/java/javax/measure/unit/AnnotatedUnit.java index aa2cc60..209f483 100644 --- a/src/main/java/javax/measure/unit/AnnotatedUnit.java +++ b/src/main/java/javax/measure/unit/AnnotatedUnit.java @@ -80,7 +80,6 @@ */ package javax.measure.unit; -import javax.measure.converter.UnitConverter; import javax.measure.quantity.Quantity; /** @@ -103,7 +102,7 @@ * respectively.

* * @author Jean-Marie Dautelle - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version 1.0.1 ($Revision: 89 $), $Date: 2010-01-31 23:15:22 +0100 (So, 31 Jän 2010) $ */ public class AnnotatedUnit extends DerivedUnit { diff --git a/src/main/java/javax/measure/unit/BaseUnit.java b/src/main/java/javax/measure/unit/BaseUnit.java index 8e9b620..c040a42 100644 --- a/src/main/java/javax/measure/unit/BaseUnit.java +++ b/src/main/java/javax/measure/unit/BaseUnit.java @@ -80,7 +80,6 @@ */ package javax.measure.unit; -import javax.measure.converter.UnitConverter; import javax.measure.quantity.Quantity; /** @@ -96,7 +95,7 @@ * the base units of a specific {@link SystemOfUnits}.

* * @author Jean-Marie Dautelle - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version 1.0.1 ($Revision: 89 $), $Date: 2010-01-31 23:15:22 +0100 (So, 31 Jän 2010) $ * @see * Wikipedia: SI base unit */ @@ -105,7 +104,7 @@ public class BaseUnit extends Unit { /** * Holds the symbol. */ - private final String _symbol; + private final String symbol; /** * Creates a base unit having the specified symbol. @@ -115,7 +114,7 @@ public class BaseUnit extends Unit { * associated to a different unit. */ public BaseUnit(String symbol) { - _symbol = symbol; + this.symbol = symbol; // Checks if the symbol is associated to a different unit. synchronized (Unit.SYMBOL_TO_UNIT) { Unit unit = Unit.SYMBOL_TO_UNIT.get(symbol); @@ -134,7 +133,7 @@ public BaseUnit(String symbol) { * @return this base unit symbol. */ public String getSymbol() { - return _symbol; + return symbol; } @Override @@ -144,12 +143,12 @@ public boolean equals(Object that) { if (!(that instanceof BaseUnit)) return false; BaseUnit thatUnit = (BaseUnit) that; - return this._symbol.equals(thatUnit._symbol); + return this.symbol.equals(thatUnit.symbol); } @Override public int hashCode() { - return _symbol.hashCode(); + return symbol.hashCode(); } @Override @@ -162,5 +161,16 @@ public UnitConverter getConverterToSI() { return UnitConverter.IDENTITY; } + @Override + public Dimension getDimension() { + return Dimension.getModel().getDimension(this); + } + + @Override + public UnitConverter getDimensionalTransform() { + return Dimension.getModel().getTransform(this); + } + private static final long serialVersionUID = 1L; + } diff --git a/src/main/java/javax/measure/unit/CompoundUnit.java b/src/main/java/javax/measure/unit/CompoundUnit.java index 8fa913f..7aa0b9f 100644 --- a/src/main/java/javax/measure/unit/CompoundUnit.java +++ b/src/main/java/javax/measure/unit/CompoundUnit.java @@ -80,7 +80,6 @@ */ package javax.measure.unit; -import javax.measure.converter.UnitConverter; import javax.measure.quantity.Quantity; /** @@ -96,7 +95,7 @@ * [/code]

* * @author Jean-Marie Dautelle - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version 1.0.1 ($Revision: 89 $), $Date: 2010-01-31 23:15:22 +0100 (So, 31 Jän 2010) $ */ public final class CompoundUnit extends DerivedUnit { diff --git a/src/main/java/javax/measure/unit/Dimension.java b/src/main/java/javax/measure/unit/Dimension.java index 874d02e..d4bf31f 100644 --- a/src/main/java/javax/measure/unit/Dimension.java +++ b/src/main/java/javax/measure/unit/Dimension.java @@ -82,7 +82,7 @@ import java.io.Serializable; -import javax.measure.converter.UnitConverter; +import javax.measure.unit.UnitConverter; import javax.measure.quantity.Dimensionless; /** @@ -96,9 +96,9 @@ * @author Jean-Marie Dautelle * @author Werner Keil * - * @version 1.0.3 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - * @see - * Wikipedia: Dimensional Analysis + * @version 1.0.3 ($Revision: 89 $), $Date: 2010-01-31 23:15:22 +0100 (So, 31 Jän 2010) $ + * @see + * BIPM: SI Brochure Chapter 1.3 */ public final class Dimension implements Serializable { @@ -138,9 +138,9 @@ public final class Dimension implements Serializable { public static final Dimension ELECTRIC_CURRENT = new Dimension('I'); /** - * Holds temperature dimension (Q). + * Holds temperature dimension (Θ). */ - public static final Dimension TEMPERATURE = new Dimension('Q'); + public static final Dimension TEMPERATURE = new Dimension('Θ'); /** * Holds amount of substance dimension (N). @@ -162,7 +162,7 @@ public final class Dimension implements Serializable { * * @param symbol the associated symbol. */ - public Dimension(char symbol) { + private Dimension(char symbol) { pseudoUnit = new BaseUnit("[" + symbol + "]"); } @@ -182,8 +182,8 @@ private Dimension(Unit pseudoUnit) { * @param that the dimension multiplicand. * @return this * that */ - public final Dimension times(Dimension that) { - return new Dimension(this.pseudoUnit.times(that.pseudoUnit)); + public final Dimension multiply(Dimension that) { + return new Dimension(this.pseudoUnit.multiply(that.pseudoUnit)); } /** diff --git a/src/main/java/javax/measure/unit/NonSI.java b/src/main/java/javax/measure/unit/NonSI.java index fd7d1af..ed4d5e6 100644 --- a/src/main/java/javax/measure/unit/NonSI.java +++ b/src/main/java/javax/measure/unit/NonSI.java @@ -88,8 +88,6 @@ import java.util.HashSet; import java.util.Set; -import javax.measure.converter.LogConverter; -import javax.measure.converter.RationalConverter; import javax.measure.quantity.*; /** @@ -99,7 +97,7 @@ * * @author Jean-Marie Dautelle * @author Werner Keil - * @version 1.8 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version 1.8 ($Revision: 89 $), $Date: 2010-01-31 23:15:22 +0100 (So, 31 Jän 2010) $ */ public final class NonSI extends SystemOfUnits { @@ -162,7 +160,7 @@ public static NonSI getInstance() { * A dimensionless unit equals to pi (standard name * Ï€). */ - public static final Unit PI = nonSI(Unit.ONE.times(StrictMath.PI)); + public static final Unit PI = nonSI(Unit.ONE.multiply(StrictMath.PI)); /** * A dimensionless unit equals to 0.01 (standard name @@ -193,7 +191,7 @@ public static NonSI getInstance() { * A unit of length equal to 0.3048 m (standard name * ft). */ - public static final Unit FOOT = nonSI(METRE.times( + public static final Unit FOOT = nonSI(METRE.multiply( INTERNATIONAL_FOOT_DIVIDEND).divide(INTERNATIONAL_FOOT_DIViSOR)); /** @@ -201,13 +199,13 @@ public static NonSI getInstance() { * foot_survey_us). See also: foot */ - public static final Unit FOOT_SURVEY_US = nonSI(METRE.times(1200).divide(3937)); + public static final Unit FOOT_SURVEY_US = nonSI(METRE.multiply(1200).divide(3937)); /** * A unit of length equal to 0.9144 m (standard name * yd). */ - public static final Unit YARD = nonSI(FOOT.times(3)); + public static final Unit YARD = nonSI(FOOT.multiply(3)); /** * A unit of length equal to 0.0254 m (standard name @@ -219,14 +217,14 @@ public static NonSI getInstance() { * A unit of length equal to 1609.344 m (standard name * mi). */ - public static final Unit MILE = nonSI(METRE.times(1609344).divide( + public static final Unit MILE = nonSI(METRE.multiply(1609344).divide( 1000)); /** * A unit of length equal to 1852.0 m (standard name * nmi). */ - public static final Unit NAUTICAL_MILE = nonSI(METRE.times(1852)); + public static final Unit NAUTICAL_MILE = nonSI(METRE.multiply(1852)); /** * A unit of length equal to 1E-10 m (standard name @@ -238,13 +236,13 @@ public static NonSI getInstance() { * A unit of length equal to the average distance from the center of the * Earth to the center of the Sun (standard name ua). */ - public static final Unit ASTRONOMICAL_UNIT = nonSI(METRE.times(149597870691.0)); + public static final Unit ASTRONOMICAL_UNIT = nonSI(METRE.multiply(149597870691.0)); /** * A unit of length equal to the distance that light travels in one year * through a vacuum (standard name ly). */ - public static final Unit LIGHT_YEAR = nonSI(METRE.times(9.460528405e15)); + public static final Unit LIGHT_YEAR = nonSI(METRE.multiply(9.460528405e15)); /** * A unit of length equal to the distance at which a star would appear to @@ -253,7 +251,7 @@ public static NonSI getInstance() { * in the direction perpendicular to the direction to the star (standard * name pc). */ - public static final Unit PARSEC = nonSI(METRE.times(30856770e9)); + public static final Unit PARSEC = nonSI(METRE.multiply(30856770e9)); /** * A unit of length equal to 0.013837 {@link #INCH} exactly (standard name @@ -261,7 +259,7 @@ public static NonSI getInstance() { * * @see #PIXEL */ - public static final Unit POINT = nonSI(INCH.times(13837).divide( + public static final Unit POINT = nonSI(INCH.multiply(13837).divide( 1000000)); /** @@ -284,17 +282,17 @@ public static NonSI getInstance() { * A unit of duration equal to 60 s (standard name * min). */ - public static final Unit MINUTE = nonSI(SI.SECOND.times(60)); + public static final Unit MINUTE = nonSI(SI.SECOND.multiply(60)); /** * A unit of duration equal to 60 {@link #MINUTE} (standard name h). */ - public static final Unit HOUR = nonSI(MINUTE.times(60)); + public static final Unit HOUR = nonSI(MINUTE.multiply(60)); /** * A unit of duration equal to 24 {@link #HOUR} (standard name d). */ - public static final Unit DAY = nonSI(HOUR.times(24)); + public static final Unit DAY = nonSI(HOUR.multiply(24)); /** * A unit of duration equal to the time required for a complete rotation of @@ -302,26 +300,26 @@ public static NonSI getInstance() { * meridian, equal to 23 hours, 56 minutes, 4.09 seconds (standard name * day_sidereal). */ - public static final Unit DAY_SIDEREAL = nonSI(SECOND.times(86164.09)); + public static final Unit DAY_SIDEREAL = nonSI(SECOND.multiply(86164.09)); /** * A unit of duration equal to 7 {@link #DAY} (standard name * week). */ - public static final Unit WEEK = nonSI(DAY.times(7)); + public static final Unit WEEK = nonSI(DAY.multiply(7)); /** * A unit of duration equal to 365 {@link #DAY} (standard name * year). */ - public static final Unit YEAR_CALENDAR = nonSI(DAY.times(365)); + public static final Unit YEAR_CALENDAR = nonSI(DAY.multiply(365)); /** * A unit of duration equal to one complete revolution of the earth about * the sun, relative to the fixed stars, or 365 days, 6 hours, 9 minutes, * 9.54 seconds (standard name year_sidereal). */ - public static final Unit YEAR_SIDEREAL = nonSI(SECOND.times(31558149.54)); + public static final Unit YEAR_SIDEREAL = nonSI(SECOND.multiply(31558149.54)); /** * The Julian year, as used in astronomy and other sciences, is a time unit @@ -329,7 +327,7 @@ public static NonSI getInstance() { * "year" (symbol "a" from the Latin annus, annata) used in various * scientific contexts. */ - public static final Unit YEAR_JULIEN = nonSI(SECOND.times(31557600)); + public static final Unit YEAR_JULIEN = nonSI(SECOND.multiply(31557600)); // //////// // Mass // @@ -338,19 +336,19 @@ public static NonSI getInstance() { * A unit of mass equal to 1/12 the mass of the carbon-12 atom (standard * name u). */ - public static final Unit ATOMIC_MASS = nonSI(KILOGRAM.times(1e-3 / AVOGADRO_CONSTANT)); + public static final Unit ATOMIC_MASS = nonSI(KILOGRAM.multiply(1e-3 / AVOGADRO_CONSTANT)); /** * A unit of mass equal to the mass of the electron (standard name * me). */ - public static final Unit ELECTRON_MASS = nonSI(KILOGRAM.times(9.10938188e-31)); + public static final Unit ELECTRON_MASS = nonSI(KILOGRAM.multiply(9.10938188e-31)); /** * A unit of mass equal to 453.59237 grams (avoirdupois pound, * standard name lb). */ - public static final Unit POUND = nonSI(KILOGRAM.times( + public static final Unit POUND = nonSI(KILOGRAM.multiply( AVOIRDUPOIS_POUND_DIVIDEND).divide(AVOIRDUPOIS_POUND_DIVISOR)); /** @@ -362,19 +360,19 @@ public static NonSI getInstance() { * A unit of mass equal to 2000 {@link #POUND} (short ton, standard name * ton_us). */ - public static final Unit TON_US = nonSI(POUND.times(2000)); + public static final Unit TON_US = nonSI(POUND.multiply(2000)); /** * A unit of mass equal to 2240 {@link #POUND} (long ton, standard name * ton_uk). */ - public static final Unit TON_UK = nonSI(POUND.times(2240)); + public static final Unit TON_UK = nonSI(POUND.multiply(2240)); /** * A unit of mass equal to 1000 kg (metric ton, standard name * t). */ - public static final Unit METRIC_TON = nonSI(KILOGRAM.times(1000)); + public static final Unit METRIC_TON = nonSI(KILOGRAM.multiply(1000)); // /////////////////// // Electric charge // @@ -383,20 +381,20 @@ public static NonSI getInstance() { * A unit of electric charge equal to the charge on one electron (standard * name e). */ - public static final Unit E = nonSI(COULOMB.times(ELEMENTARY_CHARGE)); + public static final Unit E = nonSI(COULOMB.multiply(ELEMENTARY_CHARGE)); /** * A unit of electric charge equal to equal to the product of Avogadro's * number (see {@link SI#MOLE}) and the charge (1 e) on a single electron * (standard name Fd). */ - public static final Unit FARADAY = nonSI(COULOMB.times(ELEMENTARY_CHARGE * AVOGADRO_CONSTANT)); // e/mol + public static final Unit FARADAY = nonSI(COULOMB.multiply(ELEMENTARY_CHARGE * AVOGADRO_CONSTANT)); // e/mol /** * A unit of electric charge which exerts a force of one dyne on an equal * charge at a distance of one centimeter (standard name Fr). */ - public static final Unit FRANKLIN = nonSI(COULOMB.times(3.3356e-10)); + public static final Unit FRANKLIN = nonSI(COULOMB.multiply(3.3356e-10)); // /////////////// // Temperature // @@ -405,7 +403,7 @@ public static NonSI getInstance() { * A unit of temperature equal to 5/9 °K (standard name * °R). */ - public static final Unit RANKINE = nonSI(KELVIN.times(5).divide(9)); + public static final Unit RANKINE = nonSI(KELVIN.multiply(5).divide(9)); /** * A unit of temperature equal to degree Rankine minus @@ -413,7 +411,7 @@ public static NonSI getInstance() { * * @see #RANKINE */ - public static final Unit FAHRENHEIT = nonSI(RANKINE.plus(459.67)); + public static final Unit FAHRENHEIT = nonSI(RANKINE.add(459.67)); // ///////// // Angle // @@ -422,7 +420,7 @@ public static NonSI getInstance() { * A unit of angle equal to a full circle or 2π * {@link SI#RADIAN} (standard name rev). */ - public static final Unit REVOLUTION = nonSI(RADIAN.times(2).times(PI).asType(Angle.class)); + public static final Unit REVOLUTION = nonSI(RADIAN.multiply(2).multiply(PI).asType(Angle.class)); /** * A unit of angle equal to 1/360 {@link #REVOLUTION} (standard name deg). @@ -486,7 +484,7 @@ public static NonSI getInstance() { * A unit of velocity relative to the speed of light (standard name * c). */ - public static final Unit C = nonSI(METRES_PER_SECOND.times(299792458)); + public static final Unit C = nonSI(METRES_PER_SECOND.multiply(299792458)); // //////////////// // Acceleration // @@ -495,7 +493,7 @@ public static NonSI getInstance() { * A unit of acceleration equal to the gravity at the earth's surface * (standard name grav). */ - public static final Unit G = nonSI(METRES_PER_SQUARE_SECOND.times(STANDARD_GRAVITY_DIVIDEND).divide(STANDARD_GRAVITY_DIVISOR)); + public static final Unit G = nonSI(METRES_PER_SQUARE_SECOND.multiply(STANDARD_GRAVITY_DIVIDEND).divide(STANDARD_GRAVITY_DIVISOR)); // //////// // Area // @@ -504,12 +502,12 @@ public static NonSI getInstance() { * A unit of area equal to 100 m² (standard name a * ). */ - public static final Unit ARE = nonSI(SQUARE_METRE.times(100)); + public static final Unit ARE = nonSI(SQUARE_METRE.multiply(100)); /** * A unit of area equal to 100 {@link #ARE} (standard name ha). */ - public static final Unit HECTARE = nonSI(ARE.times(100)); // Exact. + public static final Unit HECTARE = nonSI(ARE.multiply(100)); // Exact. // /////////////// // Data Amount // @@ -518,7 +516,7 @@ public static NonSI getInstance() { * A unit of data amount equal to 8 {@link SI#BIT} (BinarY TErm, standard name * byte). */ - public static final Unit BYTE = nonSI(BIT.times(8)); + public static final Unit BYTE = nonSI(BIT.multiply(8)); /** * Equivalent {@link #BYTE} @@ -533,8 +531,8 @@ public static NonSI getInstance() { * electromagnetic unit of magnetomotive force, equal to 10/4 * πampere-turn (standard name Gi). */ - public static final Unit GILBERT = nonSI(SI.AMPERE.times( - 10).divide(4).times(PI).asType(ElectricCurrent.class)); + public static final Unit GILBERT = nonSI(SI.AMPERE.multiply( + 10).divide(4).multiply(PI).asType(ElectricCurrent.class)); // ////////// // Energy // @@ -549,7 +547,7 @@ public static NonSI getInstance() { * A unit of energy equal to one electron-volt (standard name * eV, also recognized keV, MeV, GeV). */ - public static final Unit ELECTRON_VOLT = nonSI(JOULE.times(ELEMENTARY_CHARGE)); + public static final Unit ELECTRON_VOLT = nonSI(JOULE.multiply(ELEMENTARY_CHARGE)); // /////////////// // Illuminance // @@ -558,7 +556,7 @@ public static NonSI getInstance() { * A unit of illuminance equal to 1E4 Lx (standard name * La). */ - public static final Unit LAMBERT = nonSI(LUX.times(10000)); + public static final Unit LAMBERT = nonSI(LUX.multiply(10000)); // ///////////////// // Magnetic Flux // @@ -591,13 +589,13 @@ public static NonSI getInstance() { * A unit of force equal to 9.80665 N (standard name * kgf). */ - public static final Unit KILOGRAM_FORCE = nonSI(NEWTON.times( + public static final Unit KILOGRAM_FORCE = nonSI(NEWTON.multiply( STANDARD_GRAVITY_DIVIDEND).divide(STANDARD_GRAVITY_DIVISOR)); /** * A unit of force equal to {@link #POUND}·{@link #G} (standard name lbf). */ - public static final Unit POUND_FORCE = nonSI(NEWTON.times( + public static final Unit POUND_FORCE = nonSI(NEWTON.multiply( 1L * AVOIRDUPOIS_POUND_DIVIDEND * STANDARD_GRAVITY_DIVIDEND).divide(1L * AVOIRDUPOIS_POUND_DIVISOR * STANDARD_GRAVITY_DIVISOR)); // ///////// @@ -608,7 +606,7 @@ public static NonSI getInstance() { * kilograms at a velocity of 1 meter per second (metric, standard name * hp). */ - public static final Unit HORSEPOWER = nonSI(WATT.times(735.499)); + public static final Unit HORSEPOWER = nonSI(WATT.multiply(735.499)); // //////////// // Pressure // @@ -617,26 +615,26 @@ public static NonSI getInstance() { * A unit of pressure equal to the average pressure of the Earth's * atmosphere at sea level (standard name atm). */ - public static final Unit ATMOSPHERE = nonSI(PASCAL.times(101325)); + public static final Unit ATMOSPHERE = nonSI(PASCAL.multiply(101325)); /** * A unit of pressure equal to 100 kPa (standard name * bar). */ - public static final Unit BAR = nonSI(PASCAL.times(100000)); + public static final Unit BAR = nonSI(PASCAL.multiply(100000)); /** * A unit of pressure equal to the pressure exerted at the Earth's surface * by a column of mercury 1 millimeter high (standard name mmHg * ). */ - public static final Unit MILLIMETRE_OF_MERCURY = nonSI(PASCAL.times(133.322)); + public static final Unit MILLIMETRE_OF_MERCURY = nonSI(PASCAL.multiply(133.322)); /** * A unit of pressure equal to the pressure exerted at the Earth's surface * by a column of mercury 1 inch high (standard name inHg). */ - public static final Unit INCH_OF_MERCURY = nonSI(PASCAL.times(3386.388)); + public static final Unit INCH_OF_MERCURY = nonSI(PASCAL.multiply(3386.388)); // /////////////////////////// // Radiation dose absorbed // @@ -660,13 +658,13 @@ public static NonSI getInstance() { * A unit of radioctive activity equal to the activity of a gram of radium * (standard name Ci). */ - public static final Unit CURIE = nonSI(BECQUEREL.times(37000000000L)); + public static final Unit CURIE = nonSI(BECQUEREL.multiply(37000000000L)); /** * A unit of radioctive activity equal to 1 million radioactive * disintegrations per second (standard name Rd). */ - public static final Unit RUTHERFORD = nonSI(SI.BECQUEREL.times(1000000)); + public static final Unit RUTHERFORD = nonSI(SI.BECQUEREL.multiply(1000000)); // /////////////// // Solid angle // @@ -675,7 +673,7 @@ public static NonSI getInstance() { * A unit of solid angle equal to 4 π steradians * (standard name sphere). */ - public static final Unit SPHERE = nonSI(STERADIAN.times(4).times(PI).asType(SolidAngle.class)); + public static final Unit SPHERE = nonSI(STERADIAN.multiply(4).multiply(PI).asType(SolidAngle.class)); // ////////// // Volume // @@ -697,7 +695,7 @@ public static NonSI getInstance() { * gallon is based on the Queen Anne or Wine gallon occupying 231 cubic * inches (standard name gal). */ - public static final Unit GALLON_LIQUID_US = nonSI(CUBIC_INCH.times(231)); + public static final Unit GALLON_LIQUID_US = nonSI(CUBIC_INCH.multiply(231)); /** * A unit of volume equal to 1 / 128 {@link #GALLON_LIQUID_US} (standard name @@ -709,13 +707,13 @@ public static NonSI getInstance() { * A unit of volume equal to one US dry gallon. (standard name * gallon_dry_us). */ - public static final Unit GALLON_DRY_US = nonSI(CUBIC_INCH.times( + public static final Unit GALLON_DRY_US = nonSI(CUBIC_INCH.multiply( 2688025).divide(10000)); /** * A unit of volume equal to 4.546 09 {@link #LITRE} (standard name gal_uk). */ - public static final Unit GALLON_UK = nonSI(LITRE.times(454609).divide(100000)); + public static final Unit GALLON_UK = nonSI(LITRE.multiply(454609).divide(100000)); /** * A unit of volume equal to 1 / 160 {@link #GALLON_UK} (standard name @@ -729,7 +727,7 @@ public static NonSI getInstance() { /** * A unit of dynamic viscosity equal to 1 g/(cm·s) (cgs unit). */ - public static final Unit POISE = nonSI(GRAM.divide(CENTI(METRE).times(SECOND))).asType(DynamicViscosity.class); + public static final Unit POISE = nonSI(GRAM.divide(CENTI(METRE).multiply(SECOND))).asType(DynamicViscosity.class); /** * A unit of kinematic viscosity equal to 1 cm²/s (cgs unit). @@ -752,7 +750,7 @@ public static NonSI getInstance() { * A unit used to measure the ionizing ability of radiation (standard name * Roentgen). */ - public static final Unit ROENTGEN = nonSI(COULOMB.divide(KILOGRAM).times(2.58e-4)); + public static final Unit ROENTGEN = nonSI(COULOMB.divide(KILOGRAM).multiply(2.58e-4)); // /////////////////// // Collection View // @@ -797,7 +795,7 @@ private BinaryPrefix() { * @return unit.times(1024). */ public static Unit KIBI(Unit unit) { - return unit.times(1024); + return unit.multiply(1024); } /** @@ -808,7 +806,7 @@ public static Unit KIBI(Unit unit) { * @return unit.times(1048576). */ public static Unit MEBI(Unit unit) { - return unit.times(1048576); + return unit.multiply(1048576); } /** @@ -819,7 +817,7 @@ public static Unit MEBI(Unit unit) { * @return unit.times(1073741824). */ public static final Unit GIBI(Unit unit) { - return unit.times(1073741824); + return unit.multiply(1073741824); } /** @@ -830,7 +828,7 @@ public static final Unit GIBI(Unit unit) { * @return unit.times(1099511627776L). */ public static Unit TEBI(Unit unit) { - return unit.times(1099511627776L); + return unit.multiply(1099511627776L); } /** @@ -841,7 +839,7 @@ public static Unit TEBI(Unit unit) { * @return unit.times(1125899906842624L). */ public static Unit PEBI(Unit unit) { - return unit.times(1125899906842624L); + return unit.multiply(1125899906842624L); } /** @@ -852,7 +850,7 @@ public static Unit PEBI(Unit unit) { * @return unit.times(1152921504606846976L). */ public static Unit EXBI(Unit unit) { - return unit.times(1152921504606846976L); + return unit.multiply(1152921504606846976L); } } diff --git a/src/main/java/javax/measure/unit/ProductUnit.java b/src/main/java/javax/measure/unit/ProductUnit.java index f7e6dc8..d919a73 100644 --- a/src/main/java/javax/measure/unit/ProductUnit.java +++ b/src/main/java/javax/measure/unit/ProductUnit.java @@ -82,8 +82,6 @@ import java.io.Serializable; -import javax.measure.converter.LinearConverter; -import javax.measure.converter.UnitConverter; import javax.measure.quantity.Quantity; /** @@ -96,7 +94,7 @@ * * @author Jean-Marie Dautelle * @version 1.0, April 15, 2009 - * @see Unit#times(Unit) + * @see Unit#multiply(Unit) * @see Unit#divide(Unit) * @see Unit#pow(int) * @see Unit#root(int) @@ -398,7 +396,7 @@ public Unit toSI() { Unit unit = _elements[i]._unit.toSI(); unit = unit.pow(_elements[i]._pow); unit = unit.root(_elements[i]._root); - systemUnit = systemUnit.times(unit); + systemUnit = systemUnit.multiply(unit); } return (Unit) systemUnit; } @@ -411,7 +409,7 @@ public final UnitConverter getConverterToSI() { for (int i = 0; i < _elements.length; i++) { Element e = _elements[i]; UnitConverter cvtr = e._unit.getConverterToSI(); - if (!(cvtr instanceof LinearConverter)) + if (!(cvtr.isLinear())) throw new UnsupportedOperationException(e._unit + " is non-linear, cannot convert"); if (e._root != 1) throw new UnsupportedOperationException(e._unit + " holds a base unit with fractional exponent"); @@ -442,7 +440,40 @@ private boolean hasOnlyStandardUnit() { return true; } - /** + @Override + public Dimension getDimension() { + Dimension dimension = Dimension.NONE; + for (int i = 0; i < this.getUnitCount(); i++) { + Unit unit = this.getUnit(i); + Dimension d = unit.getDimension().pow(this.getUnitPow(i)).root(this.getUnitRoot(i)); + dimension = dimension.multiply(d); + } + return dimension; + } + + @Override + public UnitConverter getDimensionalTransform() { + UnitConverter converter = UnitConverter.IDENTITY; + for (int i = 0; i < this.getUnitCount(); i++) { + Unit unit = this.getUnit(i); + UnitConverter cvtr = unit.getDimensionalTransform(); + if (!(cvtr.isLinear())) + throw new UnsupportedOperationException(cvtr.getClass() + " is non-linear, cannot convert product unit"); + if (this.getUnitRoot(i) != 1) + throw new UnsupportedOperationException(this + " holds a unit with fractional exponent"); + int pow = this.getUnitPow(i); + if (pow < 0) { // Negative power. + pow = -pow; + cvtr = cvtr.inverse(); + } + for (int j = 0; j < pow; j++) { + converter = converter.concatenate(cvtr); + } + } + return converter; + } + + /** * Returns the greatest common divisor (Euclid's algorithm). * * @param m the first number. @@ -517,7 +548,6 @@ public int getPow() { public int getRoot() { return _root; } - private static final long serialVersionUID = 1L; } diff --git a/src/main/java/javax/measure/unit/SI.java b/src/main/java/javax/measure/unit/SI.java index 75db9ae..889d867 100644 --- a/src/main/java/javax/measure/unit/SI.java +++ b/src/main/java/javax/measure/unit/SI.java @@ -85,7 +85,6 @@ import java.util.HashSet; import java.util.Set; -import javax.measure.converter.RationalConverter; import javax.measure.quantity.*; /** @@ -103,7 +102,7 @@ * * @author Jean-Marie Dautelle * @author Werner Keil - * @version 1.8 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version 1.8 ($Revision: 89 $), $Date: 2010-01-31 23:15:22 +0100 (So, 31 Jän 2010) $ * @see Wikipedia: International System of Units */ public final class SI extends SystemOfUnits { @@ -250,7 +249,7 @@ public static final SI getInstance() { * mathematician and physicist Sir Isaac Newton (1642-1727). */ public static final AlternateUnit NEWTON = si(new AlternateUnit( - "N", METRE.times(KILOGRAM).divide(SECOND.pow(2)))); + "N", METRE.multiply(KILOGRAM).divide(SECOND.pow(2)))); /** * The derived unit for pressure, stress (Pa). @@ -267,7 +266,7 @@ public static final SI getInstance() { * It is named after the English physicist James Prescott Joule (1818-1889). */ public static final AlternateUnit JOULE = si(new AlternateUnit( - "J", NEWTON.times(METRE))); + "J", NEWTON.multiply(METRE))); /** * The derived unit for power, radiant, flux (W). @@ -285,7 +284,7 @@ public static final SI getInstance() { * Charles Augustin de Coulomb (1736-1806). */ public static final AlternateUnit COULOMB = si(new AlternateUnit( - "C", SECOND.times(AMPERE))); + "C", SECOND.multiply(AMPERE))); /** * The derived unit for electric potential difference, electromotive force @@ -333,7 +332,7 @@ public static final SI getInstance() { * Wilhelm Eduard Weber (1804-1891). */ public static final AlternateUnit WEBER = si(new AlternateUnit( - "Wb", VOLT.times(SECOND))); + "Wb", VOLT.multiply(SECOND))); /** * The derived unit for magnetic flux density (T). @@ -360,7 +359,7 @@ public static final SI getInstance() { * (at one atmosphere of pressure) is 0 Cel, while the boiling point is * 100 Cel. */ - public static final Unit CELSIUS = si(KELVIN.plus(273.15)); + public static final Unit CELSIUS = si(KELVIN.add(273.15)); /** * The derived unit for luminous flux (lm). @@ -368,7 +367,7 @@ public static final SI getInstance() { * by a source of one candela intensity radiating equally in all directions. */ public static final AlternateUnit LUMEN = si(new AlternateUnit( - "lm", CANDELA.times(STERADIAN))); + "lm", CANDELA.multiply(STERADIAN))); /** * The derived unit for illuminance (lx). @@ -432,18 +431,18 @@ public static final SI getInstance() { * The metric unit for area quantities (m2). */ public static final Unit SQUARE_METRE = si(new ProductUnit( - METRE.times(METRE))); + METRE.multiply(METRE))); /** * The metric unit for volume quantities (m3). */ public static final Unit CUBIC_METRE = si(new ProductUnit( - SQUARE_METRE.times(METRE))); + SQUARE_METRE.multiply(METRE))); /** * Equivalent to KILO(METRE). */ - public static final Unit KILOMETRE = METRE.times(1000); + public static final Unit KILOMETRE = METRE.multiply(1000); /** * Equivalent to CENTI(METRE). diff --git a/src/main/java/javax/measure/unit/SystemOfUnits.java b/src/main/java/javax/measure/unit/SystemOfUnits.java index f2d861d..737586a 100644 --- a/src/main/java/javax/measure/unit/SystemOfUnits.java +++ b/src/main/java/javax/measure/unit/SystemOfUnits.java @@ -80,7 +80,9 @@ */ package javax.measure.unit; +import java.util.HashSet; import java.util.Set; +import javax.measure.quantity.Quantity; /** *

This class represents a system of units, it groups units together @@ -90,7 +92,8 @@ * held by {@link NonSI}).

* * @author Jean-Marie Dautelle - * @version 1.0, April 15, 2009 + * @author Werner Keil + * @version 1.0.1, $Date: 2010-01-31 23:15:22 +0100 (So, 31 Jän 2010) $ */ public abstract class SystemOfUnits { @@ -100,4 +103,55 @@ public abstract class SystemOfUnits { * @return the collection of units. */ public abstract Set> getUnits(); -} + + /** + * Returns the the units defined in this system of specified type + * (convenience method). This method returns all the units in this + * system of units having the same standard unit as the one defined + * by the specified quantity class. This method is more selective than + * the {@link #getUnits(javax.measure.unit.Dimension)} since units may + * have the same dimension and still be used to measure quantities + * of different kinds. + * + * @param type the type of the units to be returned. + * @return the collection of units of specified type. + */ + @SuppressWarnings("unchecked") + public Set> getUnits(Class type) { + Set> units = new HashSet(); + Unit standardUnit = null; + try { + standardUnit = (Unit) type.getField("UNIT").get(null); + } catch (Exception e) { + throw new UnsupportedOperationException( + "The quantity class " + type + " does not have a public static field UNIT holding the SI unit " + " for the quantity."); + } + for (Unit unit : getUnits()) { + if (unit.toSI().equals(standardUnit)) { + units.add((Unit)unit); + } + } + return units; + } + + /** + * Returns the units defined in this system having the specified + * dimension (convenience method). This method returns all the units + * in this system of units having the specified dimension. + * This method is less selective than {@link #getUnits(java.lang.Class)} + * since units may have the same dimension and still be used to measure + * quantities of different kinds. + * + * @param dimension the dimension of the units to be returned. + * @return the collection of units of specified dimension. + */ + public Set> getUnits(Dimension dimension) { + Set> units = new HashSet>(); + for (Unit unit : getUnits()) { + if (unit.getDimension().equals(dimension)) { + units.add(unit); + } + } + return units; + } +} \ No newline at end of file diff --git a/src/main/java/javax/measure/unit/TransformedUnit.java b/src/main/java/javax/measure/unit/TransformedUnit.java index 94ab454..26eb312 100644 --- a/src/main/java/javax/measure/unit/TransformedUnit.java +++ b/src/main/java/javax/measure/unit/TransformedUnit.java @@ -80,7 +80,6 @@ */ package javax.measure.unit; -import javax.measure.converter.UnitConverter; import javax.measure.quantity.Quantity; /** @@ -94,13 +93,13 @@ * [/code]

* *

Transformed units have no label. But like any other units, - * they may have labels attached to them (see {@link javax.measure.unit.format.SymbolMap + * they may have labels attached to them (see {@link javax.measure.unit.SymbolMap * SymbolMap}

* *

Instances of this class are created through the {@link Unit#transform} method.

* * @author Jean-Marie Dautelle - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version 1.0.1 ($Revision: 89 $), $Date: 2010-01-31 23:15:22 +0100 (So, 31 Jän 2010) $ */ public final class TransformedUnit extends DerivedUnit { diff --git a/src/main/java/javax/measure/unit/UCUM.java b/src/main/java/javax/measure/unit/UCUM.java deleted file mode 100644 index e3d653a..0000000 --- a/src/main/java/javax/measure/unit/UCUM.java +++ /dev/null @@ -1,689 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.unit; - -import static javax.measure.unit.SI.MetricPrefix.*; - -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; -import javax.measure.quantity.*; - -/** - *

This class contains the units ({@link SI} and {@link NonSI}) as defined - * in the - * Uniform Code for Units of Measure.

- * - *

Compatibility with existing {@link javax.measure.unit.SI SI}/ - * {@link javax.measure.unit.NonSI NonSI} units has been given - * priority over strict adherence to the standard. We have attempted to note - * every place where the definitions in this class deviate from the - * UCUM standard, but such notes are likely to be incomplete.

- * - * @author Eric Russell - * @author Werner Keil - * @version 1.4.2, ($Revision: 76 $) $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - * @see UCUM - */ -public final class UCUM extends SystemOfUnits { - - /** Holds collection of all UCUM units. */ - private static HashSet> UNITS = new HashSet>(); - - /** - * Returns the unique instance of this class. - * - * @return the UCUM instance. - */ - public static UCUM getInstance() { - return INSTANCE; - } - private static final UCUM INSTANCE = new UCUM(); - - /** - * Adds a new unit to the collection. - * @param unit the unit being added. - * @return unit. - */ - private static U ucum(U unit) { - UNITS.add(unit); - return unit; - } - - /** - * Default constructor (prevents this class from being instantiated). - */ - private UCUM() { - } - - /** - * Returns a read only view over the units defined in this class. - * @return the collection of SI units. - */ - public Set> getUnits() { - return Collections.unmodifiableSet(UNITS); - } - ////////////////////////////// - // BASE UNITS: UCUM 4.2 §25 // - ////////////////////////////// - /** As per UCUM standard. */ - public static final BaseUnit METER = ucum(SI.METRE); - /** As per UCUM standard. */ - public static final BaseUnit SECOND = ucum(SI.SECOND); - /** - * We deviate slightly from the standard here, to maintain compatibility - * with the existing SI units. In UCUM, the gram is the base unit of mass, - * rather than the kilogram. This doesn't have much effect on the units - * themselves, but it does make formatting the units a challenge. - */ - public static final Unit GRAM = ucum(SI.GRAM); - /** As per UCUM standard. */ - public static final AlternateUnit RADIAN = ucum(SI.RADIAN); - /** As per UCUM standard. */ - public static final BaseUnit KELVIN = ucum(SI.KELVIN); - /** As per UCUM standard. */ - public static final AlternateUnit COULOMB = ucum(SI.COULOMB); - /** As per UCUM standard. */ - public static final BaseUnit CANDELA = ucum(SI.CANDELA); - /////////////////////////////////////////////// - // DIMENSIONLESS DERIVED UNITS: UCUM 4.3 §26 // - /////////////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit TRIILLIONS = ucum(Unit.ONE.times(1000000000000L)); - /** As per UCUM standard. */ - public static final Unit BILLIONS = ucum(Unit.ONE.times(1000000000)); - /** As per UCUM standard. */ - public static final Unit MILLIONS = ucum(Unit.ONE.times(1000000)); - /** As per UCUM standard. */ - public static final Unit THOUSANDS = ucum(Unit.ONE.times(1000)); - /** As per UCUM standard. */ - public static final Unit HUNDREDS = ucum(Unit.ONE.times(100)); - /** As per UCUM standard. */ - public static final Unit PI = ucum(Unit.ONE.times(StrictMath.PI)); - /** As per UCUM standard. */ - public static final Unit PERCENT = ucum(Unit.ONE.divide(100)); - /** As per UCUM standard. */ - public static final Unit PER_THOUSAND = ucum(Unit.ONE.divide(1000)); - /** As per UCUM standard. */ - public static final Unit PER_MILLION = ucum(Unit.ONE.divide(1000000)); - /** As per UCUM standard. */ - public static final Unit PER_BILLION = ucum(Unit.ONE.divide(1000000000)); - /** As per UCUM standard. */ - public static final Unit PER_TRILLION = ucum(Unit.ONE.divide(1000000000000L)); - //////////////////////////// - // SI UNITS: UCUM 4.3 §27 // - //////////////////////////// - /** - * We deviate slightly from the standard here, to maintain compatibility - * with the existing SI units. In UCUM, the mole is no longer a base unit, - * but is defined as Unit.ONE.times(6.0221367E23). - */ - public static final Unit MOLE = ucum(SI.MOLE); - /** - * We deviate slightly from the standard here, to maintain compatibility - * with the existing SI units. In UCUM, the steradian is defined as - * RADIAN.pow(2). - */ - public static final Unit STERADIAN = ucum(SI.STERADIAN); - /** As per UCUM standard. */ - public static final Unit HERTZ = (Unit) ucum(SI.HERTZ); - /** As per UCUM standard. */ - public static final Unit NEWTON = ucum(SI.NEWTON); - /** As per UCUM standard. */ - public static final Unit PASCAL = ucum(SI.PASCAL); - /** As per UCUM standard. */ - public static final Unit JOULE = ucum(SI.JOULE); - /** As per UCUM standard. */ - public static final Unit WATT = ucum(SI.WATT); - /** - * We deviate slightly from the standard here, to maintain compatability - * with the existing SI units. In UCUM, the ampere is defined as - * COULOMB.divide(SECOND). - */ - public static final Unit AMPERE = ucum(SI.AMPERE); - public static final Unit AMPERE_TURN = ucum(SI.AMPERE_TURN); - /** - * We deviate slightly from the standard here, to maintain compatibility - * with the existing SI units. In UCUM, the volt is defined as - * JOULE.divide(COULOMB). - */ - public static final Unit VOLT = ucum(SI.VOLT); - /** As per UCUM standard. */ - public static final Unit FARAD = ucum(SI.FARAD); - /** As per UCUM standard. */ - public static final Unit OHM = ucum(SI.OHM); - /** As per UCUM standard. */ - public static final Unit SIEMENS = ucum(SI.SIEMENS); - /** As per UCUM standard. */ - public static final Unit WEBER = ucum(SI.WEBER); - /** As per UCUM standard. */ - public static final Unit CELSIUS = ucum(SI.CELSIUS); - /** As per UCUM standard. */ - public static final Unit TESLA = ucum(SI.TESLA); - /** As per UCUM standard. */ - public static final Unit HENRY = ucum(SI.HENRY); - /** As per UCUM standard. */ - public static final Unit LUMEN = ucum(SI.LUMEN); - /** As per UCUM standard. */ - public static final Unit LUX = ucum(SI.LUX); - /** As per UCUM standard. */ - public static final Unit BECQUEREL = ucum(SI.BECQUEREL); - /** As per UCUM standard. */ - public static final Unit GRAY = ucum(SI.GRAY); - /** As per UCUM standard. */ - public static final Unit SIEVERT = ucum(SI.SIEVERT); - /////////////////////////////////////////////////////////////////////// - // OTHER UNITS FROM ISO 1000, ISO 2955, AND ANSI X3.50: UCUM 4.3 §28 // - /////////////////////////////////////////////////////////////////////// - // The order of GON and DEGREE has been inverted because GON is defined in terms of DEGREE - /** - * We deviate slightly from the standard here, to maintain compatibility - * with the existing NonSI units. In UCUM, the degree is defined as - * PI.times(RADIAN.divide(180)). - */ - public static final Unit DEGREE = ucum(NonSI.DEGREE_ANGLE); - /** - * We deviate slightly from the standard here, to maintain compatibility - * with the existing NonSI units. In UCUM, the grade is defined as - * DEGREE.times(0.9). - */ - public static final Unit GRADE = ucum(NonSI.GRADE); - /** As per UCUM standard. */ - public static final Unit GON = GRADE; - /** As per UCUM standard. */ - public static final Unit MINUTE_ANGLE = ucum(NonSI.MINUTE_ANGLE); - /** As per UCUM standard. */ - public static final Unit SECOND_ANGLE = ucum(NonSI.SECOND_ANGLE); - /** As per UCUM standard. */ - public static final Unit LITER = ucum(NonSI.LITRE); - /** As per UCUM standard. */ - public static final Unit ARE = ucum(NonSI.ARE); - /** As per UCUM standard. */ - public static final Unit MINUTE = ucum(NonSI.MINUTE); - /** As per UCUM standard. */ - public static final Unit HOUR = ucum(NonSI.HOUR); - /** As per UCUM standard. */ - public static final Unit DAY = ucum(NonSI.DAY); - /** As per UCUM standard. */ - public static final Unit YEAR_TROPICAL = ucum(DAY.times(365.24219)); - /** As per UCUM standard. */ - public static final Unit YEAR_JULIAN = ucum(DAY.times(365.25)); - /** As per UCUM standard. */ - public static final Unit YEAR_GREGORIAN = ucum(DAY.times(365.2425)); - /** As per UCUM standard. */ - public static final Unit YEAR = ucum(DAY.times(365.25)); - /** As per UCUM standard. */ - public static final Unit MONTH_SYNODAL = ucum(DAY.times(29.53059)); - /** As per UCUM standard. */ - public static final Unit MONTH_JULIAN = ucum(YEAR_JULIAN.divide(12)); - /** As per UCUM standard. */ - public static final Unit MONTH_GREGORIAN = ucum(YEAR_GREGORIAN.divide(12)); - /** As per UCUM standard. */ - public static final Unit MONTH = ucum(YEAR_JULIAN.divide(12)); - /** As per UCUM standard. */ - public static final Unit TONNE = ucum(NonSI.METRIC_TON); - /** As per UCUM standard. */ - public static final Unit BAR = ucum(NonSI.BAR); - /** As per UCUM standard. */ - public static final Unit ATOMIC_MASS_UNIT = ucum(NonSI.ATOMIC_MASS); - /** As per UCUM standard. */ - public static final Unit ELECTRON_VOLT = ucum(NonSI.ELECTRON_VOLT); - /** As per UCUM standard. */ - public static final Unit ASTRONOMIC_UNIT = ucum(NonSI.ASTRONOMICAL_UNIT); - /** As per UCUM standard. */ - public static final Unit PARSEC = ucum(NonSI.PARSEC); - ///////////////////////////////// - // NATURAL UNITS: UCUM 4.3 §29 // - ///////////////////////////////// - /** As per UCUM standard. */ - public static final Unit C = ucum(NonSI.C); - /** As per UCUM standard. */ - public static final Unit PLANCK = (Unit) ucum(JOULE.times(SECOND).times(6.6260755E-24)); - /** As per UCUM standard. */ - public static final Unit BOLTZMAN = (Unit) ucum(JOULE.divide(KELVIN).times(1.380658E-23)); - /** As per UCUM standard. */ - public static final Unit PERMITTIVITY_OF_VACUUM = (Unit) ucum(FARAD.divide(METER).times(8.854187817E-12)); - /** As per UCUM standard. */ - public static final Unit PERMEABILITY_OF_VACUUM = (Unit) ucum(NEWTON.times(4E-7 * StrictMath.PI).divide(AMPERE.pow(2))); - /** As per UCUM standard. */ - public static final Unit ELEMENTARY_CHARGE = ucum(NonSI.E); - /** As per UCUM standard. */ - public static final Unit ELECTRON_MASS = ucum(NonSI.ELECTRON_MASS); - /** As per UCUM standard. */ - public static final Unit PROTON_MASS = ucum(GRAM.times(1.6726231E-24)); - /** As per UCUM standard. */ - public static final Unit NEWTON_CONSTANT_OF_GRAVITY = (Unit) ucum(METER.pow(3).times(SI.KILOGRAM.pow(-1)).times(SECOND.pow(-2)).times(6.67259E-11)); - /** As per UCUM standard. */ - public static final Unit ACCELLERATION_OF_FREEFALL = ucum(NonSI.G); - /** As per UCUM standard. */ - public static final Unit ATMOSPHERE = ucum(NonSI.ATMOSPHERE); - /** As per UCUM standard. */ - public static final Unit LIGHT_YEAR = (Unit) ucum(NonSI.LIGHT_YEAR); - /** As per UCUM standard. */ - public static final Unit GRAM_FORCE = (Unit) ucum(GRAM.times(ACCELLERATION_OF_FREEFALL)); - // POUND_FORCE contains a forward reference to avoirdupois pound weight, so it has been moved after section §36 below - ///////////////////////////// - // CGS UNITS: UCUM 4.3 §30 // - ///////////////////////////// - /** As per UCUM standard. */ - public static final Unit KAYSER = (Unit) ucum(Unit.ONE.divide(CENTI(METER))); - /** As per UCUM standard. */ - public static final Unit GAL = (Unit) ucum(CENTI(METER).divide(SECOND.pow(2))); - /** As per UCUM standard. */ - public static final Unit DYNE = ucum(NonSI.DYNE); - /** As per UCUM standard. */ - public static final Unit ERG = ucum(NonSI.ERG); - /** As per UCUM standard. */ - public static final Unit POISE = ucum(NonSI.POISE); - /** As per UCUM standard. */ - public static final Unit BIOT = ucum(AMPERE.times(10)); - /** As per UCUM standard. */ - public static final Unit STOKES = ucum(NonSI.STOKE); - /** As per UCUM standard. */ - public static final Unit MAXWELL = ucum(NonSI.MAXWELL); - /** As per UCUM standard. */ - public static final Unit GAUSS = ucum(NonSI.GAUSS); - /** As per UCUM standard. */ - public static final Unit OERSTED = (Unit) ucum(Unit.ONE.divide(PI).times(AMPERE).divide(METER).times(250)); - /** As per UCUM standard. */ - public static final Unit GILBERT = (Unit) ucum(OERSTED.times(CENTI(METER))); - /** As per UCUM standard. */ - public static final Unit STILB = (Unit) ucum(CANDELA.divide(CENTI(METER).pow(2))); - /** As per UCUM standard. */ - public static final Unit LAMBERT = ucum(NonSI.LAMBERT); - /** As per UCUM standard. */ - public static final Unit PHOT = ucum(LUX.divide(10000)); - /** As per UCUM standard. */ - public static final Unit CURIE = ucum(NonSI.CURIE); - /** As per UCUM standard. */ - public static final Unit ROENTGEN = (Unit) ucum(NonSI.ROENTGEN); - /** As per UCUM standard. */ - public static final Unit RAD = ucum(NonSI.RAD); - /** As per UCUM standard. */ - public static final Unit REM = ucum(NonSI.REM); - ///////////////////////////////////////////////// - // INTERNATIONAL CUSTOMARY UNITS: UCUM 4.4 §31 // - ///////////////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit INCH_INTERNATIONAL = ucum(CENTI(METER).times(254).divide(100)); - /** As per UCUM standard. */ - public static final Unit FOOT_INTERNATIONAL = ucum(INCH_INTERNATIONAL.times(12)); - /** As per UCUM standard. */ - public static final Unit YARD_INTERNATIONAL = ucum(FOOT_INTERNATIONAL.times(3)); - /** As per UCUM standard. */ - public static final Unit MILE_INTERNATIONAL = ucum(FOOT_INTERNATIONAL.times(5280)); - /** As per UCUM standard. */ - public static final Unit FATHOM_INTERNATIONAL = ucum(FOOT_INTERNATIONAL.times(6)); - /** As per UCUM standard. */ - public static final Unit NAUTICAL_MILE_INTERNATIONAL = ucum(METER.times(1852)); - /** As per UCUM standard. */ - public static final Unit KNOT_INTERNATIONAL = (Unit) ucum(NAUTICAL_MILE_INTERNATIONAL.divide(HOUR)); - /** As per UCUM standard. */ - public static final Unit SQUARE_INCH_INTERNATIONAL = (Unit) ucum(INCH_INTERNATIONAL.pow(2)); - /** As per UCUM standard. */ - public static final Unit SQUARE_FOOT_INTERNATIONAL = (Unit) ucum(FOOT_INTERNATIONAL.pow(2)); - /** As per UCUM standard. */ - public static final Unit SQUARE_YARD_INTERNATIONAL = (Unit) ucum(YARD_INTERNATIONAL.pow(2)); - /** As per UCUM standard. */ - public static final Unit CUBIC_INCH_INTERNATIONAL = (Unit) ucum(INCH_INTERNATIONAL.pow(3)); - /** As per UCUM standard. */ - public static final Unit CUBIC_FOOT_INTERNATIONAL = (Unit) ucum(FOOT_INTERNATIONAL.pow(3)); - /** As per UCUM standard. */ - public static final Unit CUBIC_YARD_INTERNATIONAL = (Unit) ucum(YARD_INTERNATIONAL.pow(3)); - /** As per UCUM standard. */ - public static final Unit BOARD_FOOT_INTERNATIONAL = ucum(CUBIC_INCH_INTERNATIONAL.times(144)); - /** As per UCUM standard. */ - public static final Unit CORD_INTERNATIONAL = ucum(CUBIC_FOOT_INTERNATIONAL.times(128)); - /** As per UCUM standard. */ - public static final Unit MIL_INTERNATIONAL = ucum(INCH_INTERNATIONAL.divide(1000)); - /** As per UCUM standard. */ - public static final Unit CIRCULAR_MIL_INTERNATIONAL = (Unit) ucum(MIL_INTERNATIONAL.times(PI).divide(4)); - /** As per UCUM standard. */ - public static final Unit HAND_INTERNATIONAL = ucum(INCH_INTERNATIONAL.times(4)); - ////////////////////////////////////////// - // US SURVEY LENGTH UNITS: UCUM 4.4 §32 // - ////////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit FOOT_US_SURVEY = ucum(METER.times(1200).divide(3937)); - /** As per UCUM standard. */ - public static final Unit YARD_US_SURVEY = ucum(FOOT_US_SURVEY.times(3)); - /** As per UCUM standard. */ - public static final Unit INCH_US_SURVEY = ucum(FOOT_US_SURVEY.divide(12)); - /** As per UCUM standard. */ - public static final Unit ROD_US_SURVEY = ucum(FOOT_US_SURVEY.times(33).divide(2)); - /** As per UCUM standard. */ - public static final Unit CHAIN_US_SURVEY = ucum(ROD_US_SURVEY.times(4)); - /** As per UCUM standard. */ - public static final Unit LINK_US_SURVEY = ucum(CHAIN_US_SURVEY.divide(100)); - /** As per UCUM standard. */ - public static final Unit RAMDEN_CHAIN_US_SURVEY = ucum(FOOT_US_SURVEY.times(100)); - /** As per UCUM standard. */ - public static final Unit RAMDEN_LINK_US_SURVEY = ucum(CHAIN_US_SURVEY.divide(100)); - /** As per UCUM standard. */ - public static final Unit FATHOM_US_SURVEY = ucum(FOOT_US_SURVEY.times(6)); - /** As per UCUM standard. */ - public static final Unit FURLONG_US_SURVEY = ucum(ROD_US_SURVEY.times(40)); - /** As per UCUM standard. */ - public static final Unit MILE_US_SURVEY = ucum(FURLONG_US_SURVEY.times(8)); - /** As per UCUM standard. */ - public static final Unit ACRE_US_SURVEY = (Unit) ucum(ROD_US_SURVEY.pow(2).times(160)); - /** As per UCUM standard. */ - public static final Unit SQUARE_ROD_US_SURVEY = (Unit) ucum(ROD_US_SURVEY.pow(2)); - /** As per UCUM standard. */ - public static final Unit SQUARE_MILE_US_SURVEY = (Unit) ucum(MILE_US_SURVEY.pow(2)); - /** As per UCUM standard. */ - public static final Unit SECTION_US_SURVEY = (Unit) ucum(MILE_US_SURVEY.pow(2)); - /** As per UCUM standard. */ - public static final Unit TOWNSHP_US_SURVEY = (Unit) ucum(SECTION_US_SURVEY.times(36)); - /** As per UCUM standard. */ - public static final Unit MIL_US_SURVEY = ucum(INCH_US_SURVEY.divide(1000)); - ///////////////////////////////////////////////// - // BRITISH IMPERIAL LENGTH UNITS: UCUM 4.4 §33 // - ///////////////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit INCH_BRITISH = ucum(CENTI(METER).times(2539998).divide(1000000)); - /** As per UCUM standard. */ - public static final Unit FOOT_BRITISH = ucum(INCH_BRITISH.times(12)); - /** As per UCUM standard. */ - public static final Unit ROD_BRITISH = ucum(FOOT_BRITISH.times(33).divide(2)); - /** As per UCUM standard. */ - public static final Unit CHAIN_BRITISH = ucum(ROD_BRITISH.times(4)); - /** As per UCUM standard. */ - public static final Unit LINK_BRITISH = ucum(CHAIN_BRITISH.divide(100)); - /** As per UCUM standard. */ - public static final Unit FATHOM_BRITISH = ucum(FOOT_BRITISH.times(6)); - /** As per UCUM standard. */ - public static final Unit PACE_BRITISH = ucum(FOOT_BRITISH.times(5).divide(20)); - /** As per UCUM standard. */ - public static final Unit YARD_BRITISH = ucum(FOOT_BRITISH.times(3)); - /** As per UCUM standard. */ - public static final Unit MILE_BRITISH = ucum(FOOT_BRITISH.times(5280)); - /** As per UCUM standard. */ - public static final Unit NAUTICAL_MILE_BRITISH = ucum(FOOT_BRITISH.times(6080)); - /** As per UCUM standard. */ - public static final Unit KNOT_BRITISH = (Unit) ucum(NAUTICAL_MILE_BRITISH.divide(HOUR)); - /** As per UCUM standard. */ - public static final Unit ACRE_BRITISH = (Unit) ucum(YARD_BRITISH.pow(2).times(4840)); - /////////////////////////////////// - // US VOLUME UNITS: UCUM 4.4 §34 // - /////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit GALLON_US = ucum(CUBIC_INCH_INTERNATIONAL.times(231)); - /** As per UCUM standard. */ - public static final Unit BARREL_US = ucum(GALLON_US.times(42)); - /** As per UCUM standard. */ - public static final Unit QUART_US = ucum(GALLON_US.divide(4)); - /** As per UCUM standard. */ - public static final Unit PINT_US = ucum(QUART_US.divide(2)); - /** As per UCUM standard. */ - public static final Unit GILL_US = ucum(PINT_US.divide(4)); - /** As per UCUM standard. */ - public static final Unit FLUID_OUNCE_US = ucum(GILL_US.divide(4)); - /** As per UCUM standard. */ - public static final Unit FLUID_DRAM_US = ucum(FLUID_OUNCE_US.divide(8)); - /** As per UCUM standard. */ - public static final Unit MINIM_US = ucum(FLUID_DRAM_US.divide(60)); - /** As per UCUM standard. */ - public static final Unit CORD_US = ucum(CUBIC_FOOT_INTERNATIONAL.times(128)); - /** As per UCUM standard. */ - public static final Unit BUSHEL_US = ucum(CUBIC_INCH_INTERNATIONAL.times(215042).divide(100)); - /** As per UCUM standard. */ - public static final Unit GALLON_WINCHESTER = ucum(BUSHEL_US.divide(8)); - /** As per UCUM standard. */ - public static final Unit PECK_US = ucum(BUSHEL_US.divide(4)); - /** As per UCUM standard. */ - public static final Unit DRY_QUART_US = ucum(PECK_US.divide(8)); - /** As per UCUM standard. */ - public static final Unit DRY_PINT_US = ucum(DRY_QUART_US.divide(2)); - /** As per UCUM standard. */ - public static final Unit TABLESPOON_US = ucum(FLUID_OUNCE_US.divide(2)); - /** As per UCUM standard. */ - public static final Unit TEASPOON_US = ucum(TABLESPOON_US.divide(3)); - /** As per UCUM standard. */ - public static final Unit CUP_US = ucum(TABLESPOON_US.times(16)); - ///////////////////////////////////////////////// - // BRITISH IMPERIAL VOLUME UNITS: UCUM 4.4 §35 // - ///////////////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit GALLON_BRITISH = ucum(LITER.times(454609).divide(100000)); - /** As per UCUM standard. */ - public static final Unit PECK_BRITISH = ucum(GALLON_BRITISH.times(2)); - /** As per UCUM standard. */ - public static final Unit BUSHEL_BRITISH = ucum(PECK_BRITISH.times(4)); - /** As per UCUM standard. */ - public static final Unit QUART_BRITISH = ucum(GALLON_BRITISH.divide(4)); - /** As per UCUM standard. */ - public static final Unit PINT_BRITISH = ucum(QUART_BRITISH.divide(2)); - /** As per UCUM standard. */ - public static final Unit GILL_BRITISH = ucum(PINT_BRITISH.divide(4)); - /** As per UCUM standard. */ - public static final Unit FLUID_OUNCE_BRITISH = ucum(GILL_BRITISH.divide(5)); - /** As per UCUM standard. */ - public static final Unit FLUID_DRAM_BRITISH = ucum(FLUID_OUNCE_BRITISH.divide(8)); - /** As per UCUM standard. */ - public static final Unit MINIM_BRITISH = ucum(FLUID_DRAM_BRITISH.divide(60)); - //////////////////////////////////////////// - // AVOIRDUPOIS WIEGHT UNITS: UCUM 4.4 §36 // - //////////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit GRAIN = ucum(MILLI(GRAM).times(6479891).divide(100000)); - /** As per UCUM standard. */ - public static final Unit POUND = ucum(GRAIN.times(7000)); - /** As per UCUM standard. */ - public static final Unit OUNCE = ucum(POUND.divide(16)); - /** As per UCUM standard. */ - public static final Unit DRAM = ucum(OUNCE.divide(16)); - /** As per UCUM standard. */ - public static final Unit SHORT_HUNDREDWEIGHT = ucum(POUND.times(100)); - /** As per UCUM standard. */ - public static final Unit LONG_HUNDREDWEIGHT = ucum(POUND.times(112)); - /** As per UCUM standard. */ - public static final Unit SHORT_TON = ucum(SHORT_HUNDREDWEIGHT.times(20)); - /** As per UCUM standard. */ - public static final Unit LONG_TON = ucum(LONG_HUNDREDWEIGHT.times(20)); - /** As per UCUM standard. */ - public static final Unit STONE = ucum(POUND.times(14)); - // CONTINUED FROM SECTION §29 - // contains a forward reference to POUND, so we had to move it here, below section §36 - /** As per UCUM standard. */ - public static final Unit POUND_FORCE = (Unit) ucum(POUND.times(ACCELLERATION_OF_FREEFALL)); - ///////////////////////////////////// - // TROY WIEGHT UNITS: UCUM 4.4 §37 // - ///////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit PENNYWEIGHT_TROY = ucum(GRAIN.times(24)); - /** As per UCUM standard. */ - public static final Unit OUNCE_TROY = ucum(PENNYWEIGHT_TROY.times(24)); - /** As per UCUM standard. */ - public static final Unit POUND_TROY = ucum(OUNCE_TROY.times(12)); - ///////////////////////////////////////////// - // APOTECARIES' WEIGHT UNITS: UCUM 4.4 §38 // - ///////////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit SCRUPLE_APOTHECARY = ucum(GRAIN.times(20)); - /** As per UCUM standard. */ - public static final Unit DRAM_APOTHECARY = ucum(SCRUPLE_APOTHECARY.times(3)); - /** As per UCUM standard. */ - public static final Unit OUNCE_APOTHECARY = ucum(DRAM_APOTHECARY.times(8)); - /** As per UCUM standard. */ - public static final Unit POUND_APOTHECARY = ucum(OUNCE_APOTHECARY.times(12)); - ///////////////////////////////////////////// - // TYPESETTER'S LENGTH UNITS: UCUM 4.4 §39 // - ///////////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit LINE = ucum(INCH_INTERNATIONAL.divide(12)); - /** As per UCUM standard. */ - public static final Unit POINT = ucum(LINE.divide(6)); - /** As per UCUM standard. */ - public static final Unit PICA = ucum(POINT.times(12)); - /** As per UCUM standard. */ - public static final Unit POINT_PRINTER = ucum(INCH_INTERNATIONAL.times(13837).divide(1000000)); - /** As per UCUM standard. */ - public static final Unit PICA_PRINTER = ucum(POINT_PRINTER.times(12)); - /** As per UCUM standard. */ - public static final Unit PIED = ucum(CENTI(METER).times(3248).divide(100)); - /** As per UCUM standard. */ - public static final Unit POUCE = ucum(PIED.divide(12)); - /** As per UCUM standard. */ - public static final Unit LINGE = ucum(POUCE.divide(12)); - /** As per UCUM standard. */ - public static final Unit DIDOT = ucum(LINGE.divide(6)); - /** As per UCUM standard. */ - public static final Unit CICERO = ucum(DIDOT.times(12)); - ////////////////////////////////////// - // OTHER LEGACY UNITS: UCUM 4.5 §40 // - ////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit FAHRENHEIT = ucum(KELVIN.times(5).divide(9).plus(459.67)); - /** As per UCUM standard. */ - public static final Unit CALORIE_AT_15C = ucum(JOULE.times(41858).divide(10000)); - /** As per UCUM standard. */ - public static final Unit CALORIE_AT_20C = ucum(JOULE.times(41819).divide(10000)); - /** As per UCUM standard. */ - public static final Unit CALORIE_MEAN = ucum(JOULE.times(419002).divide(100000)); - /** As per UCUM standard. */ - public static final Unit CALORIE_INTERNATIONAL_TABLE = ucum(JOULE.times(41868).divide(10000)); - /** As per UCUM standard. */ - public static final Unit CALORIE_THERMOCHEMICAL = ucum(JOULE.times(4184).divide(1000)); - /** As per UCUM standard. */ - public static final Unit CALORIE = ucum(CALORIE_THERMOCHEMICAL); - /** As per UCUM standard. */ - public static final Unit CALORIE_FOOD = ucum(KILO(CALORIE_THERMOCHEMICAL)); - /** As per UCUM standard. */ - public static final Unit BTU_AT_39F = ucum(KILO(JOULE).times(105967).divide(100000)); - /** As per UCUM standard. */ - public static final Unit BTU_AT_59F = ucum(KILO(JOULE).times(105480).divide(100000)); - /** As per UCUM standard. */ - public static final Unit BTU_AT_60F = ucum(KILO(JOULE).times(105468).divide(100000)); - /** As per UCUM standard. */ - public static final Unit BTU_MEAN = ucum(KILO(JOULE).times(105587).divide(100000)); - /** As per UCUM standard. */ - public static final Unit BTU_INTERNATIONAL_TABLE = ucum(KILO(JOULE).times(105505585262L).divide(100000000000L)); - /** As per UCUM standard. */ - public static final Unit BTU_THERMOCHEMICAL = ucum(KILO(JOULE).times(105735).divide(100000)); - /** As per UCUM standard. */ - public static final Unit BTU = ucum(BTU_THERMOCHEMICAL); - /** As per UCUM standard. */ - public static final Unit HORSEPOWER = (Unit) ucum(FOOT_INTERNATIONAL.times(POUND_FORCE).divide(SECOND)); - ///////////////////////////////////////////////////////// - // SECTIONS §41-§43 skipped; implement later if needed // - ///////////////////////////////////////////////////////// - /////////////////////////////////////// - // MISCELLANEOUS UNITS: UCUM 4.5 §44 // - /////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit STERE = (Unit) ucum(METER.pow(3)); - /** As per UCUM standard. */ - public static final Unit ANGSTROM = ucum(NANO(METER).divide(10)); - /** As per UCUM standard. */ - public static final Unit BARN = (Unit) ucum(FEMTO(METER).pow(2).times(100)); - /** As per UCUM standard. */ - public static final Unit ATMOSPHERE_TECHNICAL = (Unit) ucum(KILO(GRAM_FORCE).divide(CENTI(METER).pow(2))); - /** As per UCUM standard. */ - public static final Unit MHO = ucum(SIEMENS.alternate("mho").asType(ElectricConductance.class)); - /** As per UCUM standard. */ - public static final Unit POUND_PER_SQUARE_INCH = (Unit) ucum(POUND_FORCE.divide(INCH_INTERNATIONAL.pow(2))); - /** As per UCUM standard. */ - public static final Unit CIRCLE = (Unit) ucum(PI.times(RADIAN).times(2)); - /** As per UCUM standard. */ - public static final Unit SPHERE = (Unit) ucum(PI.times(STERADIAN).times(4)); - /** As per UCUM standard. */ - public static final Unit CARAT_METRIC = ucum(GRAM.divide(5)); - /** As per UCUM standard. */ - public static final Unit CARAT_GOLD = ucum(Unit.ONE.divide(24)); - //////////////////////////////////////////////// - // INFORMATION TECHNOLOGY UNITS: UCUM 4.6 §45 // - //////////////////////////////////////////////// - /** As per UCUM standard. */ - public static final Unit BIT = ucum(SI.BIT); - /** As per UCUM standard. */ - public static final Unit BYTE = ucum(NonSI.BYTE); - /** As per UCUM standard. */ - public static final Unit BAUD = ucum(Unit.ONE.divide(SECOND)).asType(DataRate.class); - - /////////////////////// - // MISSING FROM UCUM // - /////////////////////// - - /** To be added to the UCUM standard. */ - public static final Unit FRAMES_PER_SECOND = ucum(Unit.ONE.divide(SECOND)).asType(Frequency.class); - -} diff --git a/src/main/java/javax/measure/unit/Unit.java b/src/main/java/javax/measure/unit/Unit.java index 3a44bcb..d6472c8 100644 --- a/src/main/java/javax/measure/unit/Unit.java +++ b/src/main/java/javax/measure/unit/Unit.java @@ -85,12 +85,6 @@ import java.text.ParsePosition; import java.util.HashMap; -import javax.measure.converter.AddConverter; -import javax.measure.converter.ConversionException; -import javax.measure.converter.LinearConverter; -import javax.measure.converter.MultiplyConverter; -import javax.measure.converter.RationalConverter; -import javax.measure.converter.UnitConverter; import javax.measure.quantity.Dimensionless; import javax.measure.quantity.Quantity; @@ -127,7 +121,7 @@ * @author Jean-Marie Dautelle * @author Steve Emmerson * @author Martin Desruisseaux - * @version 1.0, April 15, 2009 + * @version 1.1, $Date: 2010-02-03 19:21:17 +0100 (Mi, 03 Feb 2010) $ * @see Wikipedia: * Units of measurement */ @@ -210,7 +204,7 @@ public abstract class Unit implements Serializable { * * @return this.toSI().equals(this) */ - public boolean isSI() { + boolean isSI() { return toSI().equals(this); } @@ -263,25 +257,36 @@ public final Unit asType(Class type) /** * Returns the dimension of this unit (depends upon the current dimensional - * {@link Dimension.Model model}). + * {@link Dimension.Model model}). Custom system units should override + * this method. * * @return the dimension of this unit for the current model. + * @throws UnsupportedOperationException if this unit is a SI unit + * and does not override this method. */ - public final Dimension getDimension() { - Unit systemUnit = this.toSI(); - if (systemUnit instanceof BaseUnit) - return Dimension.Model.STANDARD.getDimension((BaseUnit) systemUnit); - if (systemUnit instanceof AlternateUnit) - return ((AlternateUnit) systemUnit).getParent().getDimension(); - // Product of units. - ProductUnit productUnit = (ProductUnit) systemUnit; - Dimension dimension = Dimension.NONE; - for (int i = 0; i < productUnit.getUnitCount(); i++) { - Unit unit = productUnit.getUnit(i); - Dimension d = unit.getDimension().pow(productUnit.getUnitPow(i)).root(productUnit.getUnitRoot(i)); - dimension = dimension.times(d); - } - return dimension; + public Dimension getDimension() { + if (!isSI()) + return this.toSI().getDimension(); + throw new UnsupportedOperationException( + "Custom unit of type " + this.getClass() + " should override Unit.getDimension()"); + } + + /** + * Returns the intrinsic dimensional transform of this unit + * (depends upon the current {@link Dimension.Model model} for + * {@link BaseUnit} instance). Custom system units should override this + * method. + * + * @return the intrinsic transformation of this unit relatively to its + * dimension. + * @throws UnsupportedOperationException if this unit is a SI unit + * and does not override this method. + */ + public UnitConverter getDimensionalTransform() { + if (!isSI()) + return this.getConverterToSI().concatenate(this.toSI().getDimensionalTransform()); + throw new UnsupportedOperationException( + "Custom unit of type " + this.getClass() + " should override Unit.getDimensionalTransform()"); } /** @@ -317,7 +322,7 @@ public final UnitConverter getConverterTo(Unit that) throws UnsupportedOperat * @throws UnsupportedOperationException if the converter cannot be * constructed. */ - public final UnitConverter getConverterToAny(Unit that) + public UnitConverter getConverterToAny(Unit that) throws ConversionException, UnsupportedOperationException { return ((this == that) || this.equals(that)) ? UnitConverter.IDENTITY : searchConverterTo(that); @@ -325,67 +330,23 @@ public final UnitConverter getConverterToAny(Unit that) private UnitConverter searchConverterTo(Unit that) throws ConversionException { + // First we have find a common dimension to convert to. + + // Try the SI unit. Unit thisSI = this.toSI(); Unit thatSI = that.toSI(); if (thisSI.equals(thatSI)) return that.getConverterToSI().inverse().concatenate( this.getConverterToSI()); - // Use dimensional transforms. + + // Use dimensional unit. if (!thisSI.getDimension().equals(thatSI.getDimension())) throw new ConversionException(this + " is not compatible with " + that); - // Transform between SystemUnit and BaseUnits is Identity. - UnitConverter thisTransform = this.getConverterToSI().concatenate( - transformOf(this.toBaseUnits())); - UnitConverter thatTransform = that.getConverterToSI().concatenate( - transformOf(that.toBaseUnits())); + UnitConverter thisTransform = thisSI.getDimensionalTransform().concatenate(this.getConverterToSI()); + UnitConverter thatTransform = thatSI.getDimensionalTransform().concatenate(that.getConverterToSI()); return thatTransform.inverse().concatenate(thisTransform); } - private Unit toBaseUnits() { - Unit systemUnit = this.toSI(); - if (systemUnit instanceof BaseUnit) - return systemUnit; - if (systemUnit instanceof AlternateUnit) - return ((AlternateUnit) systemUnit).getParent().toBaseUnits(); - if (systemUnit instanceof ProductUnit) { - ProductUnit productUnit = (ProductUnit) systemUnit; - Unit baseUnits = ONE; - for (int i = 0; i < productUnit.getUnitCount(); i++) { - Unit unit = productUnit.getUnit(i).toBaseUnits(); - unit = unit.pow(productUnit.getUnitPow(i)); - unit = unit.root(productUnit.getUnitRoot(i)); - baseUnits = baseUnits.times(unit); - } - return baseUnits; - } else - throw new UnsupportedOperationException("System Unit cannot be an instance of " + this.getClass()); - } - - private static UnitConverter transformOf(Unit baseUnits) throws UnsupportedOperationException { - if (baseUnits instanceof BaseUnit) - return Dimension.Model.STANDARD.getTransform((BaseUnit) baseUnits); - // Product of units. - ProductUnit productUnit = (ProductUnit) baseUnits; - UnitConverter converter = UnitConverter.IDENTITY; - for (int i = 0; i < productUnit.getUnitCount(); i++) { - Unit unit = productUnit.getUnit(i); - UnitConverter cvtr = transformOf(unit); - if (!(cvtr instanceof LinearConverter)) - throw new UnsupportedOperationException(baseUnits + " is non-linear, cannot convert"); - if (productUnit.getUnitRoot(i) != 1) - throw new UnsupportedOperationException(productUnit + " holds a base unit with fractional exponent"); - int pow = productUnit.getUnitPow(i); - if (pow < 0) { // Negative power. - pow = -pow; - cvtr = cvtr.inverse(); - } - for (int j = 0; j < pow; j++) { - converter = converter.concatenate(cvtr); - } - } - return converter; - } - /** * Returns a unit equivalent to this unit but used in expressions to * distinguish between quantities of a different nature but of the same @@ -457,7 +418,7 @@ public final Unit transform(UnitConverter operation) { * CELSIUS = KELVIN.plus(273.15)). * @return this.transform(new AddConverter(offset)) */ - public final Unit plus(double offset) { + public final Unit add(double offset) { if (offset == 0) return this; return transform(new AddConverter(offset)); @@ -470,7 +431,7 @@ public final Unit plus(double offset) { * KILOMETRE = METRE.times(1000)). * @return this.transform(new RationalConverter(factor, 1)) */ - public final Unit times(long factor) { + public final Unit multiply(long factor) { if (factor == 1) return this; return transform(new RationalConverter(BigInteger.valueOf(factor), @@ -484,7 +445,7 @@ public final Unit times(long factor) { * ELECTRON_MASS = KILOGRAM.times(9.10938188e-31)). * @return this.transform(new MultiplyConverter(factor)) */ - public final Unit times(double factor) { + public final Unit multiply(double factor) { if (factor == 1) return this; return transform(new MultiplyConverter(factor)); @@ -497,7 +458,7 @@ public final Unit times(double factor) { * @return this * that */ @SuppressWarnings("unchecked") - public final Unit times(Unit that) { + public final Unit multiply(Unit that) { if (this.equals(ONE)) return that; if (that.equals(ONE)) @@ -562,7 +523,7 @@ public final Unit divide(double divisor) { * @return this / that */ public final Unit divide(Unit that) { - return this.times(that.inverse()); + return this.multiply(that.inverse()); } /** @@ -590,7 +551,7 @@ else if (n == 0) */ public final Unit pow(int n) { if (n > 0) - return this.times(this.pow(n - 1)); + return this.multiply(this.pow(n - 1)); else if (n == 0) return ONE; else @@ -617,7 +578,7 @@ else if (n == 0) * cannot be correctly parsed (e.g. not UCUM compliant). */ public static Unit valueOf(CharSequence csq) { - return UnitFormat.getStandard().parse(csq, new ParsePosition(0)); + return UnitFormat.getInstance().parse(csq, new ParsePosition(0)); } // //////////////////// @@ -640,6 +601,16 @@ public static Unit valueOf(CharSequence csq) { */ @Override public String toString() { - return UnitFormat.getStandard().format(this); + return UnitFormat.getInstance().format(this); } + + /** + * Returns the locale representation of this unit. + * + * @return UnitFormat.getInstance().format(this) + */ +// public String toLocalString() { +// // FIXME needed? +// return UnitFormat.getInstance().format(this); +// } } diff --git a/src/main/java/javax/measure/unit/UnitFormat.java b/src/main/java/javax/measure/unit/UnitFormat.java index dfd669c..134abd0 100644 --- a/src/main/java/javax/measure/unit/UnitFormat.java +++ b/src/main/java/javax/measure/unit/UnitFormat.java @@ -86,9 +86,6 @@ import java.text.ParsePosition; import java.util.Locale; -import javax.measure.unit.format.LocalFormat; -import javax.measure.unit.format.UCUMFormat; - /** *

This class provides the interface for formatting and parsing {@link * Unit units}.

@@ -140,9 +137,9 @@ public static UnitFormat getInstance(Locale locale) { * * @return {@link UCUMFormat#getCaseSensitiveInstance()} */ - public static UnitFormat getStandard() { - return UCUMFormat.getCaseSensitiveInstance(); - } +// public static UnitFormat getStandard() { +// return UCUMFormat.getCaseSensitiveInstance(); +// } /** * Base constructor. @@ -150,6 +147,13 @@ public static UnitFormat getStandard() { protected UnitFormat() { } + /** + * Returns the {@link UnitFormat.SymbolMap} for this unit format. + * + * @return the symbol map used by this format. + */ + protected abstract SymbolMap getSymbolMap(); + /** * Formats the specified unit. * @@ -213,7 +217,90 @@ public final StringBuilder format(Unit unit, StringBuilder dest) { throw new Error(ex); // Can never happen. } } - + + /** + *

This interface provides a set of mappings between + * {@link javax.measure.unit.Unit Units} and symbols (both ways), + * and from {@link javax.measure.converter.UnitConverter + * UnitConverter}s to prefixes symbols (also both ways).

+ */ + public interface SymbolMap { + + /** + * Attaches a label to the specified unit. For example:[code] + * symbolMap.label(DAY.multiply(365), "year"); + * symbolMap.label(NonSI.FOOT, "ft"); + * [/code] + * + * @param unit the unit to label. + * @param symbol the new symbol for the unit. + * @throws UnsupportedOperationException if setting a unit label + * is not allowed. + */ + void label(Unit unit, String symbol); + + /** + * Attaches an alias to the specified unit. Multiple aliases may be + * attached to the same unit. Aliases are used during parsing to + * recognize different variants of the same unit.[code] + * symbolMap.alias(NonSI.FOOT, "foot"); + * symbolMap.alias(NonSI.FOOT, "feet"); + * symbolMap.alias(SI.METER, "meter"); + * symbolMap.alias(SI.METER, "metre"); + * [/code] + * + * @param unit the unit to label. + * @param symbol the new symbol for the unit. + * @throws UnsupportedOperationException if setting a unit alias + * is not allowed. + */ + void alias(Unit unit, String symbol); + + /** + * Attaches a label to the specified prefix. For example:[code] + * symbolMap.prefix(new RationalConverter(1000000000, 1), "G"); // GIGA + * symbolMap.prefix(new RationalConverter(1, 1000000), "µ"); // MICRO + * [/code] + * + * @param cvtr the unit converter. + * @param prefix the prefix for the converter. + * @throws UnsupportedOperationException if setting a prefix + * is not allowed. + */ + void prefix(UnitConverter cvtr, String prefix); + + /** + * Returns the unit for the specified symbol. + * + * @param symbol the symbol. + * @return the corresponding unit or null if none. + */ + Unit getUnit(String symbol); + + /** + * Returns the symbol (label) for the specified unit. + * + * @param unit the corresponding symbol. + * @return the corresponding symbol or null if none. + */ + String getSymbol(Unit unit); + + /** + * Returns the unit converter for the specified prefix. + * + * @param prefix the prefix symbol. + * @return the corresponding converter or null if none. + */ + UnitConverter getConverter(String prefix); + + /** + * Returns the prefix for the specified converter. + * + * @param converter the unit converter. + * @return the corresponding prefix or null if none. + */ + String getPrefix(UnitConverter converter); + } private static final long serialVersionUID = 1L; -} \ No newline at end of file +} diff --git a/src/main/java/javax/measure/unit/format/LocalFormat.java b/src/main/java/javax/measure/unit/format/LocalFormat.java deleted file mode 100644 index 86488aa..0000000 --- a/src/main/java/javax/measure/unit/format/LocalFormat.java +++ /dev/null @@ -1,579 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.unit.format; - -import java.io.IOException; -import java.io.StringReader; -import java.math.BigInteger; -import java.text.ParsePosition; -import java.util.Locale; -import java.util.ResourceBundle; - -import javax.measure.converter.*; -import javax.measure.unit.*; - -/** - *

This class represents the local sensitive format.

- * - *

Here is the grammar for Units in Extended Backus-Naur Form (EBNF)

- *

- * Note that the grammar has been left-factored to be suitable for use by a top-down - * parser generator such as JavaCC - *

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Lexical Entities:
<sign>:="+" | "-"
<digit>:="0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
<superscript_digit>:="⁰" | "¹" | "²" | "³" | "⁴" | "⁵" | "⁶" | "⁷" | "⁸" | "⁹"
<integer>:=(<digit>)+
<number>:=(<sign>)? (<digit>)* (".")? (<digit>)+ (("e" | "E") (<sign>)? (<digit>)+)?
<exponent>:=( "^" ( <sign> )? <integer> )
| ( "^(" (<sign>)? <integer> ( "/" (<sign>)? <integer> )? ")" )
| ( <superscript_digit> )+
<initial_char>:=? Any Unicode character excluding the following: ASCII control & whitespace (\u0000 - \u0020), decimal digits '0'-'9', '(' (\u0028), ')' (\u0029), '*' (\u002A), '+' (\u002B), '-' (\u002D), '.' (\u002E), '/' (\u005C), ':' (\u003A), '^' (\u005E), '²' (\u00B2), '³' (\u00B3), '·' (\u00B7), '¹' (\u00B9), '⁰' (\u2070), '⁴' (\u2074), '⁵' (\u2075), '⁶' (\u2076), '⁷' (\u2077), '⁸' (\u2078), '⁹' (\u2079) ?
<unit_identifier>:=<initial_char> ( <initial_char> | <digit> )*
Non-Terminals:
<unit_expr>:=<compound_expr>
<compound_expr>:=<add_expr> ( ":" <add_expr> )*
<add_expr>:=( <number> <sign> )? <mul_expr> ( <sign> <number> )?
<mul_expr>:=<exponent_expr> ( ( ( "*" | "·" ) <exponent_expr> ) | ( "/" <exponent_expr> ) )*
<exponent_expr>:=( <atomic_expr> ( <exponent> )? )
| (<integer> "^" <atomic_expr>)
| ( ( "log" ( <integer> )? ) | "ln" ) "(" <add_expr> ")" )
<atomic_expr>:=<number>
| <unit_identifier>
| ( "(" <add_expr> ")" )
- * - * @author Eric Russell - * @author Werner Keil - * @version $Revision: 76 $, $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public class LocalFormat extends UnitFormat { - - ////////////////////////////////////////////////////// - // Class variables // - ////////////////////////////////////////////////////// - /** - * serialVersionUID - */ - private static final long serialVersionUID = -2046025264383639924L; - /** Default locale instance. If the default locale is changed after the class is - initialized, this instance will no longer be used. */ - private static LocalFormat DEFAULT_INSTANCE = new LocalFormat(new SymbolMap(ResourceBundle.getBundle(LocalFormat.class.getName()))); - /** Multiplicand character */ - private static final char MIDDLE_DOT = '\u00b7'; - /** Operator precedence for the addition and subtraction operations */ - private static final int ADDITION_PRECEDENCE = 0; - /** Operator precedence for the multiplication and division operations */ - private static final int PRODUCT_PRECEDENCE = ADDITION_PRECEDENCE + 2; - /** Operator precedence for the exponentiation and logarithm operations */ - private static final int EXPONENT_PRECEDENCE = PRODUCT_PRECEDENCE + 2; - /** - * Operator precedence for a unit identifier containing no mathematical - * operations (i.e., consisting exclusively of an identifier and possibly - * a prefix). Defined to be Integer.MAX_VALUE so that no - * operator can have a higher precedence. - */ - private static final int NOOP_PRECEDENCE = Integer.MAX_VALUE; - - /////////////////// - // Class methods // - /////////////////// - /** Returns the instance for the current default locale (non-ascii characters are allowed) */ - public static LocalFormat getInstance() { - return DEFAULT_INSTANCE; - } - - /** - * Returns an instance for the given locale. - * @param locale - */ - public static LocalFormat getInstance(Locale locale) { - return new LocalFormat(new SymbolMap(ResourceBundle.getBundle(LocalFormat.class.getName(), locale))); - } - - /** Returns an instance for the given symbol map. */ - public static LocalFormat getInstance(SymbolMap symbols) { - return new LocalFormat(symbols); - } - //////////////////////// - // Instance variables // - //////////////////////// - /** - * The symbol map used by this instance to map between - * {@link javax.measure.unit.Unit Unit}s and Strings, etc... - */ - private transient SymbolMap symbolMap; - - ////////////////// - // Constructors // - ////////////////// - /** - * Base constructor. - * - * @param symbols the symbol mapping. - */ - private LocalFormat(SymbolMap symbols) { - symbolMap = symbols; - } - - //////////////////////// - // Instance methods // - //////////////////////// - /** - * Get the symbol map used by this instance to map between - * {@link javax.measure.unit.Unit Unit}s and Strings, etc... - * @return SymbolMap the current symbol map - */ - public SymbolMap getSymbols() { - return symbolMap; - } - - //////////////// - // Formatting // - //////////////// - @Override - public Appendable format(Unit unit, Appendable appendable) throws IOException { - formatInternal(unit, appendable); - return appendable; - } - - @Override - public Unit parse(CharSequence csq, ParsePosition cursor) throws IllegalArgumentException { - // Parsing reads the whole character sequence from the parse position. - int start = cursor.getIndex(); - int end = csq.length(); - if (end <= start) { - return Unit.ONE; - } - String source = csq.subSequence(start, end).toString().trim(); - if (source.length() == 0) { - return Unit.ONE; - } - try { - UnitParser parser = new UnitParser(symbolMap, new StringReader(source)); - Unit result = parser.parseUnit(); - cursor.setIndex(end); - return result; - } catch (ParseException e) { - if (e.currentToken != null) { - cursor.setErrorIndex(start + e.currentToken.endColumn); - } else { - cursor.setErrorIndex(start); - } - throw new IllegalArgumentException(e.getMessage()); - } catch (TokenMgrError e) { - cursor.setErrorIndex(start); - throw new IllegalArgumentException(e.getMessage()); - } - } - - /** - * Format the given unit to the given StringBuffer, then return the operator - * precedence of the outermost operator in the unit expression that was - * formatted. See {@link ConverterFormat} for the constants that define the - * various precedence values. - * @param unit the unit to be formatted - * @param buffer the StringBuffer to be written to - * @return the operator precedence of the outermost operator in the unit - * expression that was output - */ - private int formatInternal(Unit unit, Appendable buffer) throws IOException { - if (unit instanceof AnnotatedUnit) { - unit = ((AnnotatedUnit) unit).getRealUnit(); - } - String symbol = symbolMap.getSymbol(unit); - if (symbol != null) { - buffer.append(symbol); - return NOOP_PRECEDENCE; - } else if (unit instanceof ProductUnit) { - ProductUnit productUnit = (ProductUnit) unit; - int negativeExponentCount = 0; - // Write positive exponents first... - boolean start = true; - for (int i = 0; i < productUnit.getUnitCount(); i += 1) { - int pow = productUnit.getUnitPow(i); - if (pow >= 0) { - formatExponent(productUnit.getUnit(i), pow, productUnit.getUnitRoot(i), !start, buffer); - start = false; - } else { - negativeExponentCount += 1; - } - } - // ..then write negative exponents. - if (negativeExponentCount > 0) { - if (start) { - buffer.append('1'); - } - buffer.append('/'); - if (negativeExponentCount > 1) { - buffer.append('('); - } - start = true; - for (int i = 0; i < productUnit.getUnitCount(); i += 1) { - int pow = productUnit.getUnitPow(i); - if (pow < 0) { - formatExponent(productUnit.getUnit(i), -pow, productUnit.getUnitRoot(i), !start, buffer); - start = false; - } - } - if (negativeExponentCount > 1) { - buffer.append(')'); - } - } - return PRODUCT_PRECEDENCE; - } else if ((unit instanceof TransformedUnit) || unit.equals(SI.KILOGRAM)) { - UnitConverter converter = null; - boolean printSeparator = false; - StringBuffer temp = new StringBuffer(); - int unitPrecedence = NOOP_PRECEDENCE; - if (unit.equals(SI.KILOGRAM)) { - // A special case because KILOGRAM is a BaseUnit instead of - // a transformed unit, even though it has a prefix. - converter = Prefix.KILO.getConverter(); - unitPrecedence = formatInternal(SI.GRAM, temp); - printSeparator = true; - } else { - TransformedUnit transformedUnit = (TransformedUnit) unit; - Unit parentUnits = transformedUnit.getParentUnit(); - converter = transformedUnit.toParentUnit(); - if (parentUnits.equals(SI.KILOGRAM)) { - // More special-case hackery to work around gram/kilogram - // incosistency - parentUnits = SI.GRAM; - converter = converter.concatenate(Prefix.KILO.getConverter()); - } - unitPrecedence = formatInternal(parentUnits, temp); - printSeparator = !parentUnits.equals(Unit.ONE); - } - int result = formatConverter(converter, printSeparator, unitPrecedence, temp); - buffer.append(temp); - return result; - } else if (unit instanceof AlternateUnit) { - buffer.append(((AlternateUnit) unit).getSymbol()); - return NOOP_PRECEDENCE; - } else if (unit instanceof BaseUnit) { - buffer.append(((BaseUnit) unit).getSymbol()); - return NOOP_PRECEDENCE; - } else { - throw new IllegalArgumentException("Cannot format the given Object as a Unit (unsupported unit type " + unit.getClass().getName() + ")"); - } - } - - /** - * Format the given unit raised to the given fractional power to the - * given StringBuffer. - * @param unit Unit the unit to be formatted - * @param pow int the numerator of the fractional power - * @param root int the denominator of the fractional power - * @param continued boolean true if the converter expression - * should begin with an operator, otherwise false. This will - * always be true unless the unit being modified is equal to Unit.ONE. - * @param buffer StringBuffer the buffer to append to. No assumptions should - * be made about its content. - */ - private void formatExponent(Unit unit, int pow, int root, boolean continued, Appendable buffer) throws IOException { - if (continued) { - buffer.append(MIDDLE_DOT); - } - StringBuffer temp = new StringBuffer(); - int unitPrecedence = formatInternal(unit, temp); - if (unitPrecedence < PRODUCT_PRECEDENCE) { - temp.insert(0, '('); - temp.append(')'); - } - buffer.append(temp); - if ((root == 1) && (pow == 1)) { - // do nothing - } else if ((root == 1) && (pow > 1)) { - String powStr = Integer.toString(pow); - for (int i = 0; i < powStr.length(); i += 1) { - char c = powStr.charAt(i); - switch (c) { - case '0': - buffer.append('\u2070'); - break; - case '1': - buffer.append('\u00b9'); - break; - case '2': - buffer.append('\u00b2'); - break; - case '3': - buffer.append('\u00b3'); - break; - case '4': - buffer.append('\u2074'); - break; - case '5': - buffer.append('\u2075'); - break; - case '6': - buffer.append('\u2076'); - break; - case '7': - buffer.append('\u2077'); - break; - case '8': - buffer.append('\u2078'); - break; - case '9': - buffer.append('\u2079'); - break; - } - } - } else if (root == 1) { - buffer.append("^"); - buffer.append(String.valueOf(pow)); - } else { - buffer.append("^("); - buffer.append(String.valueOf(pow)); - buffer.append('/'); - buffer.append(String.valueOf(root)); - buffer.append(')'); - } - } - - /** - * Formats the given converter to the given StringBuffer and returns the - * operator precedence of the converter's mathematical operation. This is - * the default implementation, which supports all built-in UnitConverter - * implementations. Note that it recursively calls itself in the case of - * a {@link javax.measure.converter.UnitConverter.Compound Compound} - * converter. - * @param converter the converter to be formatted - * @param continued true if the converter expression should - * begin with an operator, otherwise false. - * @param unitPrecedence the operator precedence of the operation expressed - * by the unit being modified by the given converter. - * @param buffer the StringBuffer to append to. - * @return the operator precedence of the given UnitConverter - */ - private int formatConverter(UnitConverter converter, - boolean continued, - int unitPrecedence, - StringBuffer buffer) { - Prefix prefix = symbolMap.getPrefix(converter); - if ((prefix != null) && (unitPrecedence == NOOP_PRECEDENCE)) { - buffer.insert(0, symbolMap.getSymbol(prefix)); - return NOOP_PRECEDENCE; - } else if (converter instanceof AddConverter) { - if (unitPrecedence < ADDITION_PRECEDENCE) { - buffer.insert(0, '('); - buffer.append(')'); - } - double offset = ((AddConverter) converter).getOffset(); - if (offset < 0) { - buffer.append("-"); - offset = -offset; - } else if (continued) { - buffer.append("+"); - } - long lOffset = (long) offset; - if (lOffset == offset) { - buffer.append(lOffset); - } else { - buffer.append(offset); - } - return ADDITION_PRECEDENCE; - } else if (converter instanceof LogConverter) { - double base = ((LogConverter) converter).getBase(); - StringBuffer expr = new StringBuffer(); - if (base == StrictMath.E) { - expr.append("ln"); - } else { - expr.append("log"); - if (base != 10) { - expr.append((int) base); - } - } - expr.append("("); - buffer.insert(0, expr); - buffer.append(")"); - return EXPONENT_PRECEDENCE; - } else if (converter instanceof ExpConverter) { - if (unitPrecedence < EXPONENT_PRECEDENCE) { - buffer.insert(0, '('); - buffer.append(')'); - } - StringBuffer expr = new StringBuffer(); - double base = ((ExpConverter) converter).getBase(); - if (base == StrictMath.E) { - expr.append('e'); - } else { - expr.append((int) base); - } - expr.append('^'); - buffer.insert(0, expr); - return EXPONENT_PRECEDENCE; - } else if (converter instanceof MultiplyConverter) { - if (unitPrecedence < PRODUCT_PRECEDENCE) { - buffer.insert(0, '('); - buffer.append(')'); - } - if (continued) { - buffer.append(MIDDLE_DOT); - } - double factor = ((MultiplyConverter) converter).getFactor(); - long lFactor = (long) factor; - if (lFactor == factor) { - buffer.append(lFactor); - } else { - buffer.append(factor); - } - return PRODUCT_PRECEDENCE; - } else if (converter instanceof RationalConverter) { - if (unitPrecedence < PRODUCT_PRECEDENCE) { - buffer.insert(0, '('); - buffer.append(')'); - } - RationalConverter rationalConverter = (RationalConverter) converter; - if (!rationalConverter.getDividend().equals(BigInteger.ONE)) { - if (continued) { - buffer.append(MIDDLE_DOT); - } - buffer.append(rationalConverter.getDividend()); - } - if (!rationalConverter.getDivisor().equals(BigInteger.ONE)) { - buffer.append('/'); - buffer.append(rationalConverter.getDivisor()); - } - return PRODUCT_PRECEDENCE; - } else { - throw new IllegalArgumentException("Unable to format the given UnitConverter: " + converter.getClass()); - } - } -} diff --git a/src/main/java/javax/measure/unit/format/ParseException.java b/src/main/java/javax/measure/unit/format/ParseException.java deleted file mode 100644 index 93785f8..0000000 --- a/src/main/java/javax/measure/unit/format/ParseException.java +++ /dev/null @@ -1,271 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */ -/* JavaCCOptions:KEEP_LINE_COL=null */ -package javax.measure.unit.format; - -/** - * This exception is thrown when parse errors are encountered. - * You can explicitly create objects of this exception type by - * calling the method generateParseException in the generated - * parser. - * - * You can modify this class to customize your error reporting - * mechanisms so long as you retain the public fields. - * - * @author Jean-Marie Dautelle - * @author Werner Keil - * @version 0.9.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public class ParseException extends Exception { - - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 2932151235799168061L; - - /** - * This constructor is used by the method "generateParseException" - * in the generated parser. Calling this constructor generates - * a new object of this type with the fields "currentToken", - * "expectedTokenSequences", and "tokenImage" set. - */ - public ParseException(Token currentTokenVal, - int[][] expectedTokenSequencesVal, - String[] tokenImageVal - ) - { - super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal)); - currentToken = currentTokenVal; - expectedTokenSequences = expectedTokenSequencesVal; - tokenImage = tokenImageVal; - } - - /** - * The following constructors are for use by you for whatever - * purpose you can think of. Constructing the exception in this - * manner makes the exception behave in the normal way - i.e., as - * documented in the class "Throwable". The fields "errorToken", - * "expectedTokenSequences", and "tokenImage" do not contain - * relevant information. The JavaCC generated code does not use - * these constructors. - */ - - public ParseException() { - super(); - } - - /** Constructor with message. */ - public ParseException(String message) { - super(message); - } - - - /** - * This is the last token that has been consumed successfully. If - * this object has been created due to a parse error, the token - * followng this token will (therefore) be the first error token. - */ - public Token currentToken; - - /** - * Each entry in this array is an array of integers. Each array - * of integers represents a sequence of tokens (by their ordinal - * values) that is expected at this point of the parse. - */ - public int[][] expectedTokenSequences; - - /** - * This is a reference to the "tokenImage" array of the generated - * parser within which the parse error occurred. This array is - * defined in the generated ...Constants interface. - */ - public String[] tokenImage; - - /** - * It uses "currentToken" and "expectedTokenSequences" to generate a parse - * error message and returns it. If this object has been created - * due to a parse error, and you do not catch it (it gets thrown - * from the parser) the correct error message - * gets displayed. - */ - private static String initialise(Token currentToken, - int[][] expectedTokenSequences, - String[] tokenImage) { - String eol = System.getProperty("line.separator", "\n"); - StringBuffer expected = new StringBuffer(); - int maxSize = 0; - for (int i = 0; i < expectedTokenSequences.length; i++) { - if (maxSize < expectedTokenSequences[i].length) { - maxSize = expectedTokenSequences[i].length; - } - for (int j = 0; j < expectedTokenSequences[i].length; j++) { - expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' '); - } - if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) { - expected.append("..."); - } - expected.append(eol).append(" "); - } - String retval = "Encountered \""; - Token tok = currentToken.next; - for (int i = 0; i < maxSize; i++) { - if (i != 0) retval += " "; - if (tok.kind == 0) { - retval += tokenImage[0]; - break; - } - retval += " " + tokenImage[tok.kind]; - retval += " \""; - retval += add_escapes(tok.image); - retval += " \""; - tok = tok.next; - } - retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn; - retval += "." + eol; - if (expectedTokenSequences.length == 1) { - retval += "Was expecting:" + eol + " "; - } else { - retval += "Was expecting one of:" + eol + " "; - } - retval += expected.toString(); - return retval; - } - - /** - * The end of line string for this machine. - */ - protected String eol = System.getProperty("line.separator", "\n"); - - /** - * Used to convert raw characters to their escaped version - * when these raw version cannot be used as part of an ASCII - * string literal. - */ - static String add_escapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) - { - case 0 : - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); - } - -} -/* JavaCC - OriginalChecksum=c67b0f8ee6c642900399352b33f90efd (do not edit this line) */ diff --git a/src/main/java/javax/measure/unit/format/Prefix.java b/src/main/java/javax/measure/unit/format/Prefix.java deleted file mode 100644 index 78950d9..0000000 --- a/src/main/java/javax/measure/unit/format/Prefix.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.unit.format; - -import java.math.BigInteger; -import javax.measure.converter.UnitConverter; -import javax.measure.converter.RationalConverter; - -/** - * This class represents the prefixes recognized when parsing/formatting. - * - * @version 1.0 - */ -enum Prefix { - - YOTTA(new RationalConverter(BigInteger.TEN.pow(24), BigInteger.ONE)), - ZETTA(new RationalConverter(BigInteger.TEN.pow(21), BigInteger.ONE)), - EXA(new RationalConverter(BigInteger.TEN.pow(18), BigInteger.ONE)), - PETA(new RationalConverter(BigInteger.TEN.pow(15), BigInteger.ONE)), - TERA(new RationalConverter(BigInteger.TEN.pow(12), BigInteger.ONE)), - GIGA(new RationalConverter(BigInteger.TEN.pow(9), BigInteger.ONE)), - MEGA(new RationalConverter(BigInteger.TEN.pow(6), BigInteger.ONE)), - KILO(new RationalConverter(BigInteger.TEN.pow(3), BigInteger.ONE)), - HECTO(new RationalConverter(BigInteger.TEN.pow(2), BigInteger.ONE)), - DEKA(new RationalConverter(BigInteger.TEN.pow(1), BigInteger.ONE)), - DECI(new RationalConverter( BigInteger.ONE, BigInteger.TEN.pow(1))), - CENTI(new RationalConverter( BigInteger.ONE, BigInteger.TEN.pow(2))), - MILLI(new RationalConverter( BigInteger.ONE, BigInteger.TEN.pow(3))), - MICRO(new RationalConverter( BigInteger.ONE, BigInteger.TEN.pow(6))), - NANO(new RationalConverter( BigInteger.ONE, BigInteger.TEN.pow(9))), - PICO(new RationalConverter( BigInteger.ONE, BigInteger.TEN.pow(12))), - FEMTO(new RationalConverter( BigInteger.ONE, BigInteger.TEN.pow(15))), - ATTO(new RationalConverter( BigInteger.ONE, BigInteger.TEN.pow(18))), - ZEPTO(new RationalConverter( BigInteger.ONE, BigInteger.TEN.pow(21))), - YOCTO(new RationalConverter( BigInteger.ONE, BigInteger.TEN.pow(24))); - - private final UnitConverter _converter; - - /** - * Creates a new prefix. - * - * @param converter the associated unit converter. - */ - Prefix (UnitConverter converter) { - _converter = converter; - } - - /** - * Returns the corresponding unit converter. - * - * @return the unit converter. - */ - public UnitConverter getConverter() { - return _converter; - } -} diff --git a/src/main/java/javax/measure/unit/format/SimpleCharStream.java b/src/main/java/javax/measure/unit/format/SimpleCharStream.java deleted file mode 100644 index 13b0b44..0000000 --- a/src/main/java/javax/measure/unit/format/SimpleCharStream.java +++ /dev/null @@ -1,551 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/* Generated By:JavaCC: Do not edit this line. SimpleCharStream.java Version 5.0 */ -/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ -package javax.measure.unit.format; - -/** - * An implementation of interface CharStream, where the stream is assumed to - * contain only ASCII characters (without unicode processing). - */ - -public class SimpleCharStream -{ -/** Whether parser is static. */ - public static final boolean staticFlag = false; - int bufsize; - int available; - int tokenBegin; -/** Position in buffer. */ - public int bufpos = -1; - protected int bufline[]; - protected int bufcolumn[]; - - protected int column = 0; - protected int line = 1; - - protected boolean prevCharIsCR = false; - protected boolean prevCharIsLF = false; - - protected java.io.Reader inputStream; - - protected char[] buffer; - protected int maxNextCharInd = 0; - protected int inBuf = 0; - protected int tabSize = 8; - - protected void setTabSize(int i) { tabSize = i; } - protected int getTabSize(int i) { return tabSize; } - - - protected void ExpandBuff(boolean wrapAround) - { - char[] newbuffer = new char[bufsize + 2048]; - int newbufline[] = new int[bufsize + 2048]; - int newbufcolumn[] = new int[bufsize + 2048]; - - try - { - if (wrapAround) - { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos); - bufcolumn = newbufcolumn; - - maxNextCharInd = (bufpos += (bufsize - tokenBegin)); - } - else - { - System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin); - buffer = newbuffer; - - System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin); - bufline = newbufline; - - System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin); - bufcolumn = newbufcolumn; - - maxNextCharInd = (bufpos -= tokenBegin); - } - } - catch (Throwable t) - { - throw new Error(t.getMessage()); - } - - - bufsize += 2048; - available = bufsize; - tokenBegin = 0; - } - - protected void FillBuff() throws java.io.IOException - { - if (maxNextCharInd == available) - { - if (available == bufsize) - { - if (tokenBegin > 2048) - { - bufpos = maxNextCharInd = 0; - available = tokenBegin; - } - else if (tokenBegin < 0) - bufpos = maxNextCharInd = 0; - else - ExpandBuff(false); - } - else if (available > tokenBegin) - available = bufsize; - else if ((tokenBegin - available) < 2048) - ExpandBuff(true); - else - available = tokenBegin; - } - - int i; - try { - if ((i = inputStream.read(buffer, maxNextCharInd, available - maxNextCharInd)) == -1) - { - inputStream.close(); - throw new java.io.IOException(); - } - else - maxNextCharInd += i; - return; - } - catch(java.io.IOException e) { - --bufpos; - backup(0); - if (tokenBegin == -1) - tokenBegin = bufpos; - throw e; - } - } - -/** Start. */ - public char BeginToken() throws java.io.IOException - { - tokenBegin = -1; - char c = readChar(); - tokenBegin = bufpos; - - return c; - } - - protected void UpdateLineColumn(char c) - { - column++; - - if (prevCharIsLF) - { - prevCharIsLF = false; - line += (column = 1); - } - else if (prevCharIsCR) - { - prevCharIsCR = false; - if (c == '\n') - { - prevCharIsLF = true; - } - else - line += (column = 1); - } - - switch (c) - { - case '\r' : - prevCharIsCR = true; - break; - case '\n' : - prevCharIsLF = true; - break; - case '\t' : - column--; - column += (tabSize - (column % tabSize)); - break; - default : - break; - } - - bufline[bufpos] = line; - bufcolumn[bufpos] = column; - } - -/** Read a character. */ - public char readChar() throws java.io.IOException - { - if (inBuf > 0) - { - --inBuf; - - if (++bufpos == bufsize) - bufpos = 0; - - return buffer[bufpos]; - } - - if (++bufpos >= maxNextCharInd) - FillBuff(); - - char c = buffer[bufpos]; - - UpdateLineColumn(c); - return c; - } - - @Deprecated - /** - * @deprecated - * @see #getEndColumn - */ - - public int getColumn() { - return bufcolumn[bufpos]; - } - - @Deprecated - /** - * @deprecated - * @see #getEndLine - */ - - public int getLine() { - return bufline[bufpos]; - } - - /** Get token end column number. */ - public int getEndColumn() { - return bufcolumn[bufpos]; - } - - /** Get token end line number. */ - public int getEndLine() { - return bufline[bufpos]; - } - - /** Get token beginning column number. */ - public int getBeginColumn() { - return bufcolumn[tokenBegin]; - } - - /** Get token beginning line number. */ - public int getBeginLine() { - return bufline[tokenBegin]; - } - -/** Backup a number of characters. */ - public void backup(int amount) { - - inBuf += amount; - if ((bufpos -= amount) < 0) - bufpos += bufsize; - } - - /** Constructor. */ - public SimpleCharStream(java.io.Reader dstream, int startline, - int startcolumn, int buffersize) - { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - } - - /** Constructor. */ - public SimpleCharStream(java.io.Reader dstream, int startline, - int startcolumn) - { - this(dstream, startline, startcolumn, 4096); - } - - /** Constructor. */ - public SimpleCharStream(java.io.Reader dstream) - { - this(dstream, 1, 1, 4096); - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader dstream, int startline, - int startcolumn, int buffersize) - { - inputStream = dstream; - line = startline; - column = startcolumn - 1; - - if (buffer == null || buffersize != buffer.length) - { - available = bufsize = buffersize; - buffer = new char[buffersize]; - bufline = new int[buffersize]; - bufcolumn = new int[buffersize]; - } - prevCharIsLF = prevCharIsCR = false; - tokenBegin = inBuf = maxNextCharInd = 0; - bufpos = -1; - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader dstream, int startline, - int startcolumn) - { - ReInit(dstream, startline, startcolumn, 4096); - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader dstream) - { - ReInit(dstream, 1, 1, 4096); - } - /** Constructor. */ - public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline, - int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException - { - this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); - } - - /** Constructor. */ - public SimpleCharStream(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) - { - this(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); - } - - /** Constructor. */ - public SimpleCharStream(java.io.InputStream dstream, String encoding, int startline, - int startcolumn) throws java.io.UnsupportedEncodingException - { - this(dstream, encoding, startline, startcolumn, 4096); - } - - /** Constructor. */ - public SimpleCharStream(java.io.InputStream dstream, int startline, - int startcolumn) - { - this(dstream, startline, startcolumn, 4096); - } - - /** Constructor. */ - public SimpleCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException - { - this(dstream, encoding, 1, 1, 4096); - } - - /** Constructor. */ - public SimpleCharStream(java.io.InputStream dstream) - { - this(dstream, 1, 1, 4096); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, String encoding, int startline, - int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException - { - ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn, int buffersize) - { - ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException - { - ReInit(dstream, encoding, 1, 1, 4096); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream) - { - ReInit(dstream, 1, 1, 4096); - } - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, String encoding, int startline, - int startcolumn) throws java.io.UnsupportedEncodingException - { - ReInit(dstream, encoding, startline, startcolumn, 4096); - } - /** Reinitialise. */ - public void ReInit(java.io.InputStream dstream, int startline, - int startcolumn) - { - ReInit(dstream, startline, startcolumn, 4096); - } - /** Get token literal value. */ - public String GetImage() - { - if (bufpos >= tokenBegin) - return new String(buffer, tokenBegin, bufpos - tokenBegin + 1); - else - return new String(buffer, tokenBegin, bufsize - tokenBegin) + - new String(buffer, 0, bufpos + 1); - } - - /** Get the suffix. */ - public char[] GetSuffix(int len) - { - char[] ret = new char[len]; - - if ((bufpos + 1) >= len) - System.arraycopy(buffer, bufpos - len + 1, ret, 0, len); - else - { - System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0, - len - bufpos - 1); - System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1); - } - - return ret; - } - - /** Reset buffer when finished. */ - public void Done() - { - buffer = null; - bufline = null; - bufcolumn = null; - } - - /** - * Method to adjust line and column numbers for the start of a token. - */ - public void adjustBeginLineColumn(int newLine, int newCol) - { - int start = tokenBegin; - int len; - - if (bufpos >= tokenBegin) - { - len = bufpos - tokenBegin + inBuf + 1; - } - else - { - len = bufsize - tokenBegin + bufpos + 1 + inBuf; - } - - int i = 0, j = 0, k = 0; - int nextColDiff = 0, columnDiff = 0; - - while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize]) - { - bufline[j] = newLine; - nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j]; - bufcolumn[j] = newCol + columnDiff; - columnDiff = nextColDiff; - i++; - } - - if (i < len) - { - bufline[j] = newLine++; - bufcolumn[j] = newCol + columnDiff; - - while (i++ < len) - { - if (bufline[j = start % bufsize] != bufline[++start % bufsize]) - bufline[j] = newLine++; - else - bufline[j] = newLine; - } - } - - line = bufline[j]; - column = bufcolumn[j]; - } - -} -/* JavaCC - OriginalChecksum=ec4e178f3ccf05ea2ca32d15e09312ca (do not edit this line) */ diff --git a/src/main/java/javax/measure/unit/format/SymbolMap.java b/src/main/java/javax/measure/unit/format/SymbolMap.java deleted file mode 100644 index 703ae37..0000000 --- a/src/main/java/javax/measure/unit/format/SymbolMap.java +++ /dev/null @@ -1,275 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.unit.format; - -import java.lang.reflect.Field; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.ResourceBundle; -import javax.measure.converter.UnitConverter; -import javax.measure.unit.Unit; - -/** - *

The SymbolMap class provides a set of mappings between - * {@link javax.measure.unit.Unit Units} and symbols (both ways), - * between {@link Prefix Prefix}es and symbols - * (both ways), and from {@link javax.measure.converter.UnitConverter - * UnitConverter}s to {@link Prefix Prefix}es (one way). - * No attempt is made to verify the uniqueness of the mappings.

- * - *

Mappings are read from a ResourceBundle, the keys - * of which should consist of a fully-qualified class name, followed - * by a dot ('.'), and then the name of a static field belonging - * to that class, followed optionally by another dot and a number. - * If the trailing dot and number are not present, the value - * associated with the key is treated as a - * {@link SymbolMap#label(javax.measure.unit.Unit, String) label}, - * otherwise if the trailing dot and number are present, the value - * is treated as an {@link SymbolMap#alias(javax.measure.unit.Unit,String) alias}. - * Aliases map from String to Unit only, whereas labels map in both - * directions. A given unit may have any number of aliases, but may - * have only one label.

- * - * @author Eric Russell - * @version 1.0.1 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public class SymbolMap { - - private Map> _symbolToUnit; - private Map, String> _unitToSymbol; - private Map _symbolToPrefix; - private Map _prefixToSymbol; - private Map _converterToPrefix; - - /** - * Creates an empty mapping. - */ - public SymbolMap () { - _symbolToUnit = new HashMap>(); - _unitToSymbol = new HashMap, String>(); - _symbolToPrefix = new HashMap(); - _prefixToSymbol = new HashMap(); - _converterToPrefix = new HashMap(); - } - - /** - * Creates a symbol map from the specified resource bundle, - * - * @param rb the resource bundle. - */ - public SymbolMap (ResourceBundle rb) { - this(); - for (Enumeration i = rb.getKeys(); i.hasMoreElements();) { - String fqn = i.nextElement(); - String symbol = rb.getString(fqn); - boolean isAlias = false; - int lastDot = fqn.lastIndexOf('.'); - String className = fqn.substring(0, lastDot); - String fieldName = fqn.substring(lastDot+1, fqn.length()); - if (Character.isDigit(fieldName.charAt(0))) { - isAlias = true; - fqn = className; - lastDot = fqn.lastIndexOf('.'); - className = fqn.substring(0, lastDot); - fieldName = fqn.substring(lastDot+1, fqn.length()); - } - try { - Class c = Class.forName(className); - Field field = c.getField(fieldName); - Object value = field.get(null); - if (value instanceof Unit) { - if (isAlias) { - alias((Unit)value, symbol); - } else { - label((Unit)value, symbol); - } - } else if (value instanceof Prefix) { - label((Prefix)value, symbol); - } else { - throw new ClassCastException("unable to cast "+value+" to Unit or Prefix"); - } - } catch (Exception e) { - System.err.println("ERROR reading Unit names: " + e.toString()); - } - } - } - - /** - * Attaches a label to the specified unit. For example:[code] - * symbolMap.label(DAY.multiply(365), "year"); - * symbolMap.label(NonSI.FOOT, "ft"); - * [/code] - * - * @param unit the unit to label. - * @param symbol the new symbol for the unit. - */ - public void label (Unit unit, String symbol) { - _symbolToUnit.put(symbol, unit); - _unitToSymbol.put(unit, symbol); - } - - /** - * Attaches an alias to the specified unit. Multiple aliases may be - * attached to the same unit. Aliases are used during parsing to - * recognize different variants of the same unit.[code] - * symbolMap.alias(NonSI.FOOT, "foot"); - * symbolMap.alias(NonSI.FOOT, "feet"); - * symbolMap.alias(SI.METER, "meter"); - * symbolMap.alias(SI.METER, "metre"); - * [/code] - * - * @param unit the unit to label. - * @param symbol the new symbol for the unit. - */ - public void alias (Unit unit, String symbol) { - _symbolToUnit.put(symbol, unit); - } - - /** - * Attaches a label to the specified prefix. For example:[code] - * symbolMap.label(Prefix.GIGA, "G"); - * symbolMap.label(Prefix.MICRO, "µ"); - * [/code] - */ - public void label(Prefix prefix, String symbol) { - _symbolToPrefix.put(symbol, prefix); - _prefixToSymbol.put(prefix, symbol); - _converterToPrefix.put(prefix.getConverter(), prefix); - } - - /** - * Returns the unit for the specified symbol. - * - * @param symbol the symbol. - * @return the corresponding unit or null if none. - */ - public Unit getUnit (String symbol) { - return _symbolToUnit.get(symbol); - } - - /** - * Returns the symbol (label) for the specified unit. - * - * @param unit the corresponding symbol. - * @return the corresponding symbol or null if none. - */ - public String getSymbol (Unit unit) { - return _unitToSymbol.get(unit); - } - - /** - * Returns the prefix (if any) for the specified symbol. - * - * @param symbol the unit symbol. - * @return the corresponding prefix or null if none. - */ - public Prefix getPrefix (String symbol) { - for (Iterator i = _symbolToPrefix.keySet().iterator(); i.hasNext(); ) { - String pfSymbol = i.next(); - if (symbol.startsWith(pfSymbol)) { - return (Prefix)_symbolToPrefix.get(pfSymbol); - } - } - return null; - } - - /** - * Returns the prefix for the specified converter. - * - * @param converter the unit converter. - * @return the corresponding prefix or null if none. - */ - public Prefix getPrefix (UnitConverter converter) { - return (Prefix)_converterToPrefix.get(converter); - } - - /** - * Returns the symbol for the specified prefix. - * - * @param prefix the prefix. - * @return the corresponding symbol or null if none. - */ - public String getSymbol (Prefix prefix) { - return _prefixToSymbol.get(prefix); - } -} diff --git a/src/main/java/javax/measure/unit/format/Token.java b/src/main/java/javax/measure/unit/format/Token.java deleted file mode 100644 index 9fb446e..0000000 --- a/src/main/java/javax/measure/unit/format/Token.java +++ /dev/null @@ -1,211 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */ -/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */ -package javax.measure.unit.format; - -/** - * Describes the input token stream. - */ - -public class Token implements java.io.Serializable { - - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = 2188279658897600591L; - - /** - * An integer that describes the kind of this token. This numbering - * system is determined by JavaCCParser, and a table of these numbers is - * stored in the file ...Constants.java. - */ - public int kind; - - /** The line number of the first character of this Token. */ - public int beginLine; - /** The column number of the first character of this Token. */ - public int beginColumn; - /** The line number of the last character of this Token. */ - public int endLine; - /** The column number of the last character of this Token. */ - public int endColumn; - - /** - * The string image of the token. - */ - public String image; - - /** - * A reference to the next regular (non-special) token from the input - * stream. If this is the last token from the input stream, or if the - * token manager has not read tokens beyond this one, this field is - * set to null. This is true only if this token is also a regular - * token. Otherwise, see below for a description of the contents of - * this field. - */ - public Token next; - - /** - * This field is used to access special tokens that occur prior to this - * token, but after the immediately preceding regular (non-special) token. - * If there are no such special tokens, this field is set to null. - * When there are more than one such special token, this field refers - * to the last of these special tokens, which in turn refers to the next - * previous special token through its specialToken field, and so on - * until the first special token (whose specialToken field is null). - * The next fields of special tokens refer to other special tokens that - * immediately follow it (without an intervening regular token). If there - * is no such token, this field is null. - */ - public Token specialToken; - - /** - * An optional attribute value of the Token. - * Tokens which are not used as syntactic sugar will often contain - * meaningful values that will be used later on by the compiler or - * interpreter. This attribute value is often different from the image. - * Any subclass of Token that actually wants to return a non-null value can - * override this method as appropriate. - */ - public Object getValue() { - return null; - } - - /** - * No-argument constructor - */ - public Token() {} - - /** - * Constructs a new token for the specified Image. - */ - public Token(int kind) - { - this(kind, null); - } - - /** - * Constructs a new token for the specified Image and Kind. - */ - public Token(int kind, String image) - { - this.kind = kind; - this.image = image; - } - - /** - * Returns the image. - */ - public String toString() - { - return image; - } - - /** - * Returns a new Token object, by default. However, if you want, you - * can create and return subclass objects based on the value of ofKind. - * Simply add the cases to the switch for all those special cases. - * For example, if you have a subclass of Token called IDToken that - * you want to create if ofKind is ID, simply add something like : - * - * case MyParserConstants.ID : return new IDToken(ofKind, image); - * - * to the following switch statement. Then you can cast matchedToken - * variable to the appropriate type and use sit in your lexical actions. - */ - public static Token newToken(int ofKind, String image) - { - switch(ofKind) - { - default : return new Token(ofKind, image); - } - } - - public static Token newToken(int ofKind) - { - return newToken(ofKind, null); - } - -} -/* JavaCC - OriginalChecksum=08d08345e10cca30522247698d4478e6 (do not edit this line) */ diff --git a/src/main/java/javax/measure/unit/format/TokenMgrError.java b/src/main/java/javax/measure/unit/format/TokenMgrError.java deleted file mode 100644 index 5246c6c..0000000 --- a/src/main/java/javax/measure/unit/format/TokenMgrError.java +++ /dev/null @@ -1,228 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */ -/* JavaCCOptions: */ -package javax.measure.unit.format; - -/** Token Manager Error. */ -public class TokenMgrError extends Error -{ - - /** - * The version identifier for this Serializable class. - * Increment only if the serialized form of the - * class changes. - */ - private static final long serialVersionUID = -3348968864772188432L; - - /* - * Ordinals for various reasons why an Error of this type can be thrown. - */ - - - /** - * Lexical error occurred. - */ - static final int LEXICAL_ERROR = 0; - - /** - * An attempt was made to create a second instance of a static token manager. - */ - static final int STATIC_LEXER_ERROR = 1; - - /** - * Tried to change to an invalid lexical state. - */ - static final int INVALID_LEXICAL_STATE = 2; - - /** - * Detected (and bailed out of) an infinite loop in the token manager. - */ - static final int LOOP_DETECTED = 3; - - /** - * Indicates the reason why the exception is thrown. It will have - * one of the above 4 values. - */ - int errorCode; - - /** - * Replaces unprintable characters by their escaped (or unicode escaped) - * equivalents in the given string - */ - protected static final String addEscapes(String str) { - StringBuffer retval = new StringBuffer(); - char ch; - for (int i = 0; i < str.length(); i++) { - switch (str.charAt(i)) - { - case 0 : - continue; - case '\b': - retval.append("\\b"); - continue; - case '\t': - retval.append("\\t"); - continue; - case '\n': - retval.append("\\n"); - continue; - case '\f': - retval.append("\\f"); - continue; - case '\r': - retval.append("\\r"); - continue; - case '\"': - retval.append("\\\""); - continue; - case '\'': - retval.append("\\\'"); - continue; - case '\\': - retval.append("\\\\"); - continue; - default: - if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) { - String s = "0000" + Integer.toString(ch, 16); - retval.append("\\u" + s.substring(s.length() - 4, s.length())); - } else { - retval.append(ch); - } - continue; - } - } - return retval.toString(); - } - - /** - * Returns a detailed message for the Error when it is thrown by the - * token manager to indicate a lexical error. - * Parameters : - * EOFSeen : indicates if EOF caused the lexical error - * curLexState : lexical state in which this error occurred - * errorLine : line number when the error occurred - * errorColumn : column number when the error occurred - * errorAfter : prefix that was seen before this error occurred - * curchar : the offending character - * Note: You can customize the lexical error message by modifying this method. - */ - protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) { - return("Lexical error at line " + - errorLine + ", column " + - errorColumn + ". Encountered: " + - (EOFSeen ? " " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") + - "after : \"" + addEscapes(errorAfter) + "\""); - } - - /** - * You can also modify the body of this method to customize your error messages. - * For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not - * of end-users concern, so you can return something like : - * - * "Internal Error : Please file a bug report .... " - * - * from this method for such cases in the release version of your parser. - */ - public String getMessage() { - return super.getMessage(); - } - - /* - * Constructors of various flavors follow. - */ - - /** No arg constructor. */ - public TokenMgrError() { - } - - /** Constructor with message and reason. */ - public TokenMgrError(String message, int reason) { - super(message); - errorCode = reason; - } - - /** Full Constructor. */ - public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) { - this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason); - } -} -/* JavaCC - OriginalChecksum=8a6e5be586cca28053ad55584e013006 (do not edit this line) */ diff --git a/src/main/java/javax/measure/unit/format/UCUMFormat.java b/src/main/java/javax/measure/unit/format/UCUMFormat.java deleted file mode 100644 index 0f4e64f..0000000 --- a/src/main/java/javax/measure/unit/format/UCUMFormat.java +++ /dev/null @@ -1,472 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.unit.format; - -import static javax.measure.unit.UCUM.GRAM; - -import javax.measure.unit.UnitFormat; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.math.BigInteger; -import java.text.*; -import java.util.ResourceBundle; -import javax.measure.converter.MultiplyConverter; -import javax.measure.converter.RationalConverter; -import javax.measure.converter.UnitConverter; -import javax.measure.unit.*; -import javax.measure.quantity.Quantity; - -/** - *

- * This class provides the interface for formatting and parsing - * {@link javax.measure.unit.Unit units} according to the Uniform Code for Units of Measure - * (UCUM). - *

- * - *

- * For a technical/historical overview of this format please read Units - * of Measure in Clinical Information Systems. - *

- * - *

- * As of revision 1.16, the BNF in the UCUM standard contains an error. I've attempted to work - * around the problem by modifying the BNF productions for <Term>. Once - * the error in the standard is corrected, it may be necessary to modify the - * productions in the UCUMParser.jj file to conform to the standard. - *

- * - * @author Eric Russell - * @author Werner Keil - * @version 1.2.2 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ - */ -public abstract class UCUMFormat extends UnitFormat { - /** - * - */ - private static final long serialVersionUID = -7753687108842507677L; - - // A helper to declare bundle names for all instances - private static final String BUNDLE_BASE = UCUMFormat.class.getName(); - - // ///////////////// - // Class methods // - // ///////////////// - /** Returns the instance for formatting using "print" symbols */ - public static UCUMFormat getPrintInstance() { - return Print.DEFAULT; - } - - /** Returns the instance for formatting using user defined symbols */ - public static UCUMFormat getPrintInstance(SymbolMap symbolMap) { - return new Print(symbolMap); - } - - /** - * Returns the instance for formatting and parsing using case sensitive - * symbols - */ - public static UCUMFormat getCaseSensitiveInstance() { - return Parsing.DEFAULT_CS; - } - - /** - * Returns a case sensitive instance for formatting and parsing using user - * defined symbols - */ - public static UCUMFormat getCaseSensitiveInstance(SymbolMap symbolMap) { - return new Parsing(symbolMap, true); - } - - /** - * Returns the instance for formatting and parsing using case insensitive - * symbols - */ - public static UCUMFormat getCaseInsensitiveInstance() { - return Parsing.DEFAULT_CI; - } - - /** - * Returns a case insensitive instance for formatting and parsing using user - * defined symbols - */ - public static UCUMFormat getCaseInsensitiveInstance(SymbolMap symbolMap) { - return new Parsing(symbolMap, false); - } - - /** - * The symbol map used by this instance to map between - * {@link javax.measure.unit.Unit Unit}s and Strings. - */ - final SymbolMap _symbolMap; - - // //////////////// - // Constructors // - // //////////////// - /** - * Base constructor. - */ - UCUMFormat(SymbolMap symbolMap) { - _symbolMap = symbolMap; - } - - // ////////////// - // Formatting // - // ////////////// - public Appendable format(Unit unit, Appendable appendable) - throws IOException { - CharSequence symbol; - CharSequence annotation = null; - if (unit instanceof AnnotatedUnit) { - AnnotatedUnit annotatedUnit = (AnnotatedUnit) unit; - unit = annotatedUnit.getRealUnit(); - annotation = annotatedUnit.getAnnotation(); - } - String mapSymbol = _symbolMap.getSymbol(unit); - if (mapSymbol != null) { - symbol = mapSymbol; - } else if (unit instanceof ProductUnit) { - ProductUnit productUnit = (ProductUnit) unit; - StringBuffer app = new StringBuffer(); - for (int i = 0; i < productUnit.getUnitCount(); i++) { - if (productUnit.getUnitRoot(i) != 1) { - throw new IllegalArgumentException( - "Unable to format units in UCUM (fractional powers not supported)"); - } - StringBuffer temp = new StringBuffer(); - temp = (StringBuffer) format(productUnit.getUnit(i), temp); - if ((temp.indexOf(".") >= 0) || (temp.indexOf("/") >= 0)) { - temp.insert(0, '('); - temp.append(')'); - } - int pow = productUnit.getUnitPow(i); - if (i > 0) { - if (pow >= 0) { - app.append('.'); - } else if (i < (productUnit.getUnitCount() - 1)) { - app.append('.'); - } else { - app.append('/'); - pow = -pow; - } - } else if (pow < 0) { - app.append('/'); - pow = -pow; - } - app.append(temp); - if (pow != 1) { - app.append(Integer.toString(pow)); - } - } - symbol = app; - } else if ((unit instanceof TransformedUnit) - || unit.equals(SI.KILOGRAM)) { - StringBuffer temp = new StringBuffer(); - UnitConverter converter; - boolean printSeparator; - if (unit.equals(SI.KILOGRAM)) { - // A special case because KILOGRAM is a BaseUnit instead of - // a transformed unit, for compatability with existing SI - // unit system. - temp = format(UCUM.GRAM, temp, new FieldPosition(0)); - converter = Prefix.KILO.getConverter(); - printSeparator = true; - } else { - TransformedUnit transformedUnit = (TransformedUnit) unit; - Unit parentUnits = transformedUnit.getParentUnit(); - converter = transformedUnit.toParentUnit(); - if (parentUnits.equals(SI.KILOGRAM)) { - // More special-case hackery to work around gram/kilogram - // incosistency - parentUnits = GRAM; - converter = converter.concatenate(Prefix.KILO - .getConverter()); - } - temp = format(parentUnits, temp, new FieldPosition(0)); - printSeparator = !parentUnits.equals(Unit.ONE); - } - formatConverter(converter, printSeparator, temp); - symbol = temp; - } else if (unit instanceof BaseUnit) { - symbol = ((BaseUnit) unit).getSymbol(); - } else if (unit instanceof AlternateUnit) { - symbol = ((AlternateUnit) unit).getSymbol(); - } else { - throw new IllegalArgumentException( - "Cannot format the given Object as UCUM units (unsupported unit " - + unit.getClass().getName() - + "). " - + "Custom units types should override the toString() method as the default implementation uses the UCUM format."); - } - - appendable.append(symbol); - if (annotation != null && annotation.length() > 0) { - appendAnnotation(unit, symbol, annotation, appendable); - } - - return appendable; - } - - void appendAnnotation(Unit unit, CharSequence symbol, - CharSequence annotation, Appendable appendable) throws IOException { - appendable.append('{'); - appendable.append(annotation); - appendable.append('}'); - } - - /** - * Formats the given converter to the given StringBuffer. This is similar to - * what {@link ConverterFormat} does, but there's no need to worry about - * operator precedence here, since UCUM only supports multiplication, - * division, and exponentiation and expressions are always evaluated left- - * to-right. - * - * @param converter - * the converter to be formatted - * @param continued - * true if the converter expression should begin - * with an operator, otherwise false. This will - * always be true unless the unit being modified is equal to - * Unit.ONE. - * @param buffer - * the StringBuffer to append to. Contains the - * already-formatted unit being modified by the given converter. - */ - void formatConverter(UnitConverter converter, boolean continued, - StringBuffer buffer) { - boolean unitIsExpression = ((buffer.indexOf(".") >= 0) || (buffer - .indexOf("/") >= 0)); - Prefix prefix = _symbolMap.getPrefix(converter); - if ((prefix != null) && (!unitIsExpression)) { - buffer.insert(0, _symbolMap.getSymbol(prefix)); - } else if (converter == UnitConverter.IDENTITY) { - // do nothing - } else if (converter instanceof MultiplyConverter) { - if (unitIsExpression) { - buffer.insert(0, '('); - buffer.append(')'); - } - MultiplyConverter multiplyConverter = (MultiplyConverter) converter; - double factor = multiplyConverter.getFactor(); - long lFactor = (long) factor; - if ((lFactor != factor) || (lFactor < -9007199254740992L) - || (lFactor > 9007199254740992L)) { - throw new IllegalArgumentException( - "Only integer factors are supported in UCUM"); - } - if (continued) { - buffer.append('.'); - } - buffer.append(lFactor); - } else if (converter instanceof RationalConverter) { - if (unitIsExpression) { - buffer.insert(0, '('); - buffer.append(')'); - } - RationalConverter rationalConverter = (RationalConverter) converter; - if (!rationalConverter.getDividend().equals(BigInteger.ONE)) { - if (continued) { - buffer.append('.'); - } - buffer.append(rationalConverter.getDividend()); - } - if (!rationalConverter.getDivisor().equals(BigInteger.ONE)) { - buffer.append('/'); - buffer.append(rationalConverter.getDivisor()); - } - } else { - throw new IllegalArgumentException( - "Unable to format units in UCUM (unsupported UnitConverter " - + converter + ")"); - } - } - - // ///////////////// - // Inner classes // - // ///////////////// - /** - * The Print format is used to output units according to the "print" column - * in the UCUM standard. Because "print" symbols in UCUM are not unique, - * this class of UCUMFormat may not be used for parsing, only for - * formatting. - */ - private static class Print extends UCUMFormat { - /** - * - */ - private static final long serialVersionUID = 2990875526976721414L; - - private static final SymbolMap PRINT_SYMBOLS = new SymbolMap( - ResourceBundle - .getBundle(BUNDLE_BASE + "_Print")); - private static final Print DEFAULT = new Print(PRINT_SYMBOLS); - - public Print(SymbolMap symbols) { - super(symbols); - } - - @Override - public Unit parse(CharSequence csq, - ParsePosition pos) throws IllegalArgumentException { - throw new UnsupportedOperationException( - "The print format is for pretty-printing of units only. Parsing is not supported."); - } - - @Override - void appendAnnotation(Unit unit, CharSequence symbol, - CharSequence annotation, Appendable appendable) - throws IOException { - if (symbol != null && symbol.length() > 0) { - appendable.append('('); - appendable.append(annotation); - appendable.append(')'); - } else { - appendable.append(annotation); - } - } - } - - /** - * The Parsing format outputs formats and parses units according to the - * "c/s" or "c/i" column in the UCUM standard, depending on which SymbolMap - * is passed to its constructor. - */ - private static class Parsing extends UCUMFormat { - - /** - * - */ - private static final long serialVersionUID = -922531801940132715L; - - private static final SymbolMap CASE_SENSITIVE_SYMBOLS = new SymbolMap( - ResourceBundle.getBundle(BUNDLE_BASE + "_CS")); - private static final SymbolMap CASE_INSENSITIVE_SYMBOLS = new SymbolMap( - ResourceBundle.getBundle(BUNDLE_BASE + "_CI")); - private static final Parsing DEFAULT_CS = new Parsing( - CASE_SENSITIVE_SYMBOLS, true); - private static final Parsing DEFAULT_CI = new Parsing( - CASE_INSENSITIVE_SYMBOLS, false); - private final boolean _caseSensitive; - - public Parsing(SymbolMap symbols, boolean caseSensitive) { - super(symbols); - _caseSensitive = caseSensitive; - } - - @Override - public Unit parse(CharSequence csq, - ParsePosition cursor) throws IllegalArgumentException { - // Parsing reads the whole character sequence from the parse - // position. - int start = cursor.getIndex(); - int end = csq.length(); - if (end <= start) - return Unit.ONE; - String source = csq.subSequence(start, end).toString().trim(); - if (source.length() == 0) - return Unit.ONE; - if (!_caseSensitive) { - source = source.toUpperCase(); - } - UCUMParser parser = new UCUMParser(_symbolMap, - new ByteArrayInputStream(source.getBytes())); - try { - Unit result = parser.parseUnit(); - cursor.setIndex(end); - return result; - } catch (javax.measure.unit.format.ParseException e) { - if (e.currentToken != null) { - cursor.setErrorIndex(start + e.currentToken.endColumn); - } else { - cursor.setErrorIndex(start); - } - throw new IllegalArgumentException(e.getMessage()); - } catch (TokenMgrError e) { - cursor.setErrorIndex(start); - throw new IllegalArgumentException(e.getMessage()); - } - } - - } - -} diff --git a/src/main/java/javax/measure/unit/format/UCUMParser.java b/src/main/java/javax/measure/unit/format/UCUMParser.java deleted file mode 100644 index 953e72e..0000000 --- a/src/main/java/javax/measure/unit/format/UCUMParser.java +++ /dev/null @@ -1,591 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/* Generated By:JavaCC: Do not edit this line. UCUMParser.java */ -package javax.measure.unit.format; - -import javax.measure.unit.AnnotatedUnit; - -/** - *

- * Parser definition for parsing {@link javax.measure.unit.Unit Unit}s - * according to the - * Uniform Code for Units of Measure. - * - * @author Eric Russell - * @version 1.0 - * @see UCUM - */ -class UCUMParser implements UCUMParserConstants { - - private SymbolMap _symbols; - - public UCUMParser (SymbolMap symbols, java.io.InputStream in) { - this(in); - _symbols = symbols; - } - -// -// Parser productions -// - final public javax.measure.unit.Unit parseUnit() throws ParseException { - javax.measure.unit.Unit u; - u = Term(); - jj_consume_token(0); - {if (true) return u;} - throw new Error("Missing return statement in function"); - } - - final public javax.measure.unit.Unit Term() throws ParseException { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - javax.measure.unit.Unit temp = javax.measure.unit.Unit.ONE; - result = Component(); - label_1: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DOT: - case SOLIDUS: - ; - break; - default: - jj_la1[0] = jj_gen; - break label_1; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case DOT: - jj_consume_token(DOT); - temp = Component(); - result = result.times(temp); - break; - case SOLIDUS: - jj_consume_token(SOLIDUS); - temp = Component(); - result = result.divide(temp); - break; - default: - jj_la1[1] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return result;} - throw new Error("Missing return statement in function"); - } - - final public javax.measure.unit.Unit Component() throws ParseException { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - Token token = null; - if (jj_2_1(2147483647)) { - result = Annotatable(); - token = jj_consume_token(ANNOTATION); - {if (true) return new AnnotatedUnit(result, token.image.substring(1, token.image.length()-1));} - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ATOM: - result = Annotatable(); - {if (true) return result;} - break; - case ANNOTATION: - token = jj_consume_token(ANNOTATION); - {if (true) return new AnnotatedUnit(result, token.image.substring(1, token.image.length()-1));} - break; - case FACTOR: - token = jj_consume_token(FACTOR); - long factor = Long.parseLong(token.image); - {if (true) return result.times(factor);} - break; - case SOLIDUS: - jj_consume_token(SOLIDUS); - result = Component(); - {if (true) return javax.measure.unit.Unit.ONE.divide(result);} - break; - case 14: - jj_consume_token(14); - result = Term(); - jj_consume_token(15); - {if (true) return result;} - break; - default: - jj_la1[2] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - throw new Error("Missing return statement in function"); - } - - final public javax.measure.unit.Unit Annotatable() throws ParseException { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - Token token1 = null; - Token token2 = null; - if (jj_2_2(2147483647)) { - result = SimpleUnit(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SIGN: - token1 = jj_consume_token(SIGN); - break; - default: - jj_la1[3] = jj_gen; - ; - } - token2 = jj_consume_token(FACTOR); - int exponent = Integer.parseInt(token2.image); - if ((token1 != null) && token1.image.equals("-")) { - {if (true) return result.pow(-exponent);} - } else { - {if (true) return result.pow(exponent);} - } - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ATOM: - result = SimpleUnit(); - {if (true) return result;} - break; - default: - jj_la1[4] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - throw new Error("Missing return statement in function"); - } - - final public javax.measure.unit.Unit SimpleUnit() throws ParseException { - Token token = null; - token = jj_consume_token(ATOM); - javax.measure.unit.Unit unit = _symbols.getUnit(token.image); - if (unit == null) { - Prefix prefix = _symbols.getPrefix(token.image); - if (prefix != null) { - String prefixSymbol = _symbols.getSymbol(prefix); - unit = _symbols.getUnit(token.image.substring(prefixSymbol.length())); - if (unit != null) { - {if (true) return unit.transform(prefix.getConverter());} - } - } - {if (true) throw new ParseException();} - } else { - {if (true) return unit;} - } - throw new Error("Missing return statement in function"); - } - - private boolean jj_2_1(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_1(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(0, xla); } - } - - private boolean jj_2_2(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_2(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(1, xla); } - } - - private boolean jj_3_1() { - if (jj_3R_2()) return true; - if (jj_scan_token(ANNOTATION)) return true; - return false; - } - - private boolean jj_3R_5() { - if (jj_3R_3()) return true; - return false; - } - - private boolean jj_3R_4() { - if (jj_3R_3()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(10)) jj_scanpos = xsp; - if (jj_scan_token(FACTOR)) return true; - return false; - } - - private boolean jj_3_2() { - if (jj_3R_3()) return true; - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(10)) jj_scanpos = xsp; - if (jj_scan_token(FACTOR)) return true; - return false; - } - - private boolean jj_3R_3() { - if (jj_scan_token(ATOM)) return true; - return false; - } - - private boolean jj_3R_2() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_4()) { - jj_scanpos = xsp; - if (jj_3R_5()) return true; - } - return false; - } - - /** Generated Token Manager. */ - public UCUMParserTokenManager token_source; - SimpleCharStream jj_input_stream; - /** Current token. */ - public Token token; - /** Next token. */ - public Token jj_nt; - private int jj_ntk; - private Token jj_scanpos, jj_lastpos; - private int jj_la; - private int jj_gen; - final private int[] jj_la1 = new int[5]; - static private int[] jj_la1_0; - static { - jj_la1_init_0(); - } - private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x1800,0x1800,0x7300,0x400,0x2000,}; - } - final private JJCalls[] jj_2_rtns = new JJCalls[2]; - private boolean jj_rescan = false; - private int jj_gc = 0; - - /** Constructor with InputStream. */ - public UCUMParser(java.io.InputStream stream) { - this(stream, null); - } - /** Constructor with InputStream and supplied encoding */ - public UCUMParser(java.io.InputStream stream, String encoding) { - try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } - token_source = new UCUMParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 5; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream) { - ReInit(stream, null); - } - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream, String encoding) { - try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 5; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor. */ - public UCUMParser(java.io.Reader stream) { - jj_input_stream = new SimpleCharStream(stream, 1, 1); - token_source = new UCUMParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 5; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 5; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor with generated Token Manager. */ - public UCUMParser(UCUMParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 5; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(UCUMParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 5; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - private Token jj_consume_token(int kind) throws ParseException { - Token oldToken; - if ((oldToken = token).next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for (int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while (c != null) { - if (c.gen < jj_gen) c.first = null; - c = c.next; - } - } - } - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - static private final class LookaheadSuccess extends java.lang.Error { - - /** - * - */ - private static final long serialVersionUID = -1747326813448392305L; } - final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; Token tok = token; - while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } - if (tok != null) jj_add_error_token(kind, i); - } - if (jj_scanpos.kind != kind) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; - return false; - } - - -/** Get the next Token. */ - final public Token getNextToken() { - if (token.next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - jj_gen++; - return token; - } - -/** Get the specific Token. */ - final public Token getToken(int index) { - Token t = token; - for (int i = 0; i < index; i++) { - if (t.next != null) t = t.next; - else t = t.next = token_source.getNextToken(); - } - return t; - } - - private int jj_ntk() { - if ((jj_nt=token.next) == null) - return (jj_ntk = (token.next=token_source.getNextToken()).kind); - else - return (jj_ntk = jj_nt.kind); - } - - private java.util.List jj_expentries = new java.util.ArrayList(); - private int[] jj_expentry; - private int jj_kind = -1; - private int[] jj_lasttokens = new int[100]; - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) return; - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - for (int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) { - int[] oldentry = (int[])(it.next()); - if (oldentry.length == jj_expentry.length) { - for (int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - continue jj_entries_loop; - } - } - jj_expentries.add(jj_expentry); - break jj_entries_loop; - } - } - if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - - /** Generate ParseException. */ - public ParseException generateParseException() { - jj_expentries.clear(); - boolean[] la1tokens = new boolean[16]; - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for (int i = 0; i < 5; i++) { - if (jj_la1[i] == jj_gen) { - for (int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1< jj_gen) { - jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; - switch (i) { - case 0: jj_3_1(); break; - case 1: jj_3_2(); break; - } - } - p = p.next; - } while (p != null); - } catch(LookaheadSuccess ls) { } - } - jj_rescan = false; - } - - private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while (p.gen > jj_gen) { - if (p.next == null) { p = p.next = new JJCalls(); break; } - p = p.next; - } - p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; - } - - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } - -} diff --git a/src/main/java/javax/measure/unit/format/UCUMParserConstants.java b/src/main/java/javax/measure/unit/format/UCUMParserConstants.java deleted file mode 100644 index 3619d49..0000000 --- a/src/main/java/javax/measure/unit/format/UCUMParserConstants.java +++ /dev/null @@ -1,143 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/* Generated By:JavaCC: Do not edit this line. UCUMParserConstants.java */ -package javax.measure.unit.format; - - -/** - * Token literal values and constants. - * Generated by org.javacc.parser.OtherFilesGen#start() - */ -public interface UCUMParserConstants { - - /** End of File. */ - int EOF = 0; - /** RegularExpression Id. */ - int ATOM_CHAR = 1; - /** RegularExpression Id. */ - int ESCAPED_ATOM_CHAR = 2; - /** RegularExpression Id. */ - int TERMINAL_ATOM_CHAR = 3; - /** RegularExpression Id. */ - int LCBRACKET = 4; - /** RegularExpression Id. */ - int RCBRACKET = 5; - /** RegularExpression Id. */ - int LSBRACKET = 6; - /** RegularExpression Id. */ - int RSBRACKET = 7; - /** RegularExpression Id. */ - int ANNOTATION = 8; - /** RegularExpression Id. */ - int FACTOR = 9; - /** RegularExpression Id. */ - int SIGN = 10; - /** RegularExpression Id. */ - int DOT = 11; - /** RegularExpression Id. */ - int SOLIDUS = 12; - /** RegularExpression Id. */ - int ATOM = 13; - - /** Lexical state. */ - int DEFAULT = 0; - - /** Literal token values. */ - String[] tokenImage = { - "", - "", - "", - "", - "\"{\"", - "\"}\"", - "\"[\"", - "\"]\"", - "", - "", - "", - "\".\"", - "\"/\"", - "", - "\"(\"", - "\")\"", - }; - -} diff --git a/src/main/java/javax/measure/unit/format/UCUMParserTokenManager.java b/src/main/java/javax/measure/unit/format/UCUMParserTokenManager.java deleted file mode 100644 index 8fc8c14..0000000 --- a/src/main/java/javax/measure/unit/format/UCUMParserTokenManager.java +++ /dev/null @@ -1,494 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/* Generated By:JavaCC: Do not edit this line. UCUMParserTokenManager.java */ -package javax.measure.unit.format; - -/** Token Manager. */ -public class UCUMParserTokenManager implements UCUMParserConstants -{ - - /** Debug output. */ - public java.io.PrintStream debugStream = System.out; - /** Set debug output. */ - public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } -private final int jjStopStringLiteralDfa_0(int pos, long active0) -{ - switch (pos) - { - default : - return -1; - } -} -private final int jjStartNfa_0(int pos, long active0) -{ - return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); -} -private int jjStopAtPos(int pos, int kind) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - return pos + 1; -} -private int jjMoveStringLiteralDfa0_0() -{ - switch(curChar) - { - case 40: - return jjStopAtPos(0, 14); - case 41: - return jjStopAtPos(0, 15); - case 46: - return jjStopAtPos(0, 11); - case 47: - return jjStopAtPos(0, 12); - default : - return jjMoveNfa_0(0, 0); - } -} -private int jjMoveNfa_0(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 14; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((0xffff14fa00000000L & l) != 0L) - jjCheckNAddStates(0, 3); - else if ((0x280000000000L & l) != 0L) - { - if (kind > 10) - kind = 10; - } - if ((0xfc0014fa00000000L & l) != 0L) - { - if (kind > 13) - kind = 13; - jjCheckNAdd(5); - } - else if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 9) - kind = 9; - jjCheckNAdd(3); - } - break; - case 1: - if ((0xfffffffe00000000L & l) != 0L) - jjAddStates(4, 5); - break; - case 3: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 9) - kind = 9; - jjCheckNAdd(3); - break; - case 4: - if ((0x280000000000L & l) != 0L && kind > 10) - kind = 10; - break; - case 5: - if ((0xfc0014fa00000000L & l) == 0L) - break; - if (kind > 13) - kind = 13; - jjCheckNAdd(5); - break; - case 7: - if ((0xfffffffe00000000L & l) != 0L) - jjAddStates(6, 7); - break; - case 9: - if ((0xffff14fa00000000L & l) != 0L) - jjCheckNAddTwoStates(9, 10); - break; - case 10: - if ((0xfc0014fa00000000L & l) == 0L) - break; - if (kind > 13) - kind = 13; - jjCheckNAdd(10); - break; - case 11: - if ((0xffff14fa00000000L & l) != 0L) - jjCheckNAddStates(0, 3); - break; - case 12: - if ((0xffff14fa00000000L & l) != 0L) - jjCheckNAddTwoStates(12, 5); - break; - case 13: - if ((0xffff14fa00000000L & l) != 0L) - jjCheckNAddTwoStates(13, 6); - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 0: - if ((0x57ffffffd7ffffffL & l) != 0L) - jjCheckNAddStates(0, 3); - else if (curChar == 91) - jjCheckNAdd(7); - else if (curChar == 123) - jjCheckNAddTwoStates(1, 2); - if ((0x57ffffffd7ffffffL & l) != 0L) - { - if (kind > 13) - kind = 13; - jjCheckNAdd(5); - } - break; - case 1: - if ((0x57ffffffffffffffL & l) != 0L) - jjCheckNAddTwoStates(1, 2); - break; - case 2: - if (curChar == 125 && kind > 8) - kind = 8; - break; - case 5: - if ((0x57ffffffd7ffffffL & l) == 0L) - break; - if (kind > 13) - kind = 13; - jjCheckNAdd(5); - break; - case 6: - if (curChar == 91) - jjCheckNAdd(7); - break; - case 7: - if ((0x7fffffffd7ffffffL & l) != 0L) - jjCheckNAddTwoStates(7, 8); - break; - case 8: - if (curChar != 93) - break; - if (kind > 13) - kind = 13; - jjCheckNAddTwoStates(9, 10); - break; - case 9: - if ((0x57ffffffd7ffffffL & l) != 0L) - jjCheckNAddTwoStates(9, 10); - break; - case 10: - if ((0x57ffffffd7ffffffL & l) == 0L) - break; - if (kind > 13) - kind = 13; - jjCheckNAdd(10); - break; - case 11: - if ((0x57ffffffd7ffffffL & l) != 0L) - jjCheckNAddStates(0, 3); - break; - case 12: - if ((0x57ffffffd7ffffffL & l) != 0L) - jjCheckNAddTwoStates(12, 5); - break; - case 13: - if ((0x57ffffffd7ffffffL & l) != 0L) - jjCheckNAddTwoStates(13, 6); - break; - default : break; - } - } while(i != startsAt); - } - else - { - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - default : break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 14 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} -static final int[] jjnextStates = { - 12, 5, 13, 6, 1, 2, 7, 8, -}; - -/** Token literal values. */ -public static final String[] jjstrLiteralImages = { -"", null, null, null, null, null, null, null, null, null, null, "\56", "\57", -null, "\50", "\51", }; - -/** Lexer state names. */ -public static final String[] lexStateNames = { - "DEFAULT", -}; -protected SimpleCharStream input_stream; -private final int[] jjrounds = new int[14]; -private final int[] jjstateSet = new int[28]; -protected char curChar; -/** Constructor. */ -public UCUMParserTokenManager(SimpleCharStream stream){ - if (SimpleCharStream.staticFlag) - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - input_stream = stream; -} - -/** Constructor. */ -public UCUMParserTokenManager(SimpleCharStream stream, int lexState){ - this(stream); - SwitchTo(lexState); -} - -/** Reinitialise parser. */ -public void ReInit(SimpleCharStream stream) -{ - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); -} -private void ReInitRounds() -{ - int i; - jjround = 0x80000001; - for (i = 14; i-- > 0;) - jjrounds[i] = 0x80000000; -} - -/** Reinitialise parser. */ -public void ReInit(SimpleCharStream stream, int lexState) -{ - ReInit(stream); - SwitchTo(lexState); -} - -/** Switch to specified lex state. */ -public void SwitchTo(int lexState) -{ - if (lexState >= 1 || lexState < 0) - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - else - curLexState = lexState; -} - -protected Token jjFillToken() -{ - final Token t; - final String curTokenImage; - final int beginLine; - final int endLine; - final int beginColumn; - final int endColumn; - String im = jjstrLiteralImages[jjmatchedKind]; - curTokenImage = (im == null) ? input_stream.GetImage() : im; - beginLine = input_stream.getBeginLine(); - beginColumn = input_stream.getBeginColumn(); - endLine = input_stream.getEndLine(); - endColumn = input_stream.getEndColumn(); - t = Token.newToken(jjmatchedKind, curTokenImage); - - t.beginLine = beginLine; - t.endLine = endLine; - t.beginColumn = beginColumn; - t.endColumn = endColumn; - - return t; -} - -int curLexState = 0; -int defaultLexState = 0; -int jjnewStateCnt; -int jjround; -int jjmatchedPos; -int jjmatchedKind; - -/** Get the next Token. */ -public Token getNextToken() -{ - Token matchedToken; - int curPos = 0; - - EOFLoop : - for (;;) - { - try - { - curChar = input_stream.BeginToken(); - } - catch(java.io.IOException e) - { - jjmatchedKind = 0; - matchedToken = jjFillToken(); - return matchedToken; - } - - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_0(); - if (jjmatchedKind != 0x7fffffff) - { - if (jjmatchedPos + 1 < curPos) - input_stream.backup(curPos - jjmatchedPos - 1); - matchedToken = jjFillToken(); - return matchedToken; - } - int error_line = input_stream.getEndLine(); - int error_column = input_stream.getEndColumn(); - String error_after = null; - boolean EOFSeen = false; - try { input_stream.readChar(); input_stream.backup(1); } - catch (java.io.IOException e1) { - EOFSeen = true; - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - if (curChar == '\n' || curChar == '\r') { - error_line++; - error_column = 0; - } - else - error_column++; - } - if (!EOFSeen) { - input_stream.backup(1); - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - } - throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); - } -} - -private void jjCheckNAdd(int state) -{ - if (jjrounds[state] != jjround) - { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; - } -} -private void jjAddStates(int start, int end) -{ - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); -} -private void jjCheckNAddTwoStates(int state1, int state2) -{ - jjCheckNAdd(state1); - jjCheckNAdd(state2); -} - -private void jjCheckNAddStates(int start, int end) -{ - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); -} - -} diff --git a/src/main/java/javax/measure/unit/format/UnitParser.java b/src/main/java/javax/measure/unit/format/UnitParser.java deleted file mode 100644 index 932d91c..0000000 --- a/src/main/java/javax/measure/unit/format/UnitParser.java +++ /dev/null @@ -1,849 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/* Generated By:JavaCC: Do not edit this line. UnitParser.java */ -package javax.measure.unit.format; - -/** */ -class UnitParser implements UnitParserConstants { - - private static class Exponent { - public final int pow; - public final int root; - public Exponent (int pow, int root) { - this.pow = pow; - this.root = root; - } - } - - private SymbolMap _symbols; - - public UnitParser (SymbolMap symbols, java.io.Reader in) { - this(in); - _symbols = symbols; - } - -// -// Parser productions -// - final public javax.measure.unit.Unit parseUnit() throws ParseException { - javax.measure.unit.Unit result; - result = CompoundExpr(); - jj_consume_token(0); - {if (true) return result;} - throw new Error("Missing return statement in function"); - } - - final public javax.measure.unit.Unit CompoundExpr() throws ParseException { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - javax.measure.unit.Unit temp = javax.measure.unit.Unit.ONE; - result = AddExpr(); - label_1: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case COLON: - ; - break; - default: - jj_la1[0] = jj_gen; - break label_1; - } - jj_consume_token(COLON); - temp = AddExpr(); - result=result.compound(temp); - } - {if (true) return result;} - throw new Error("Missing return statement in function"); - } - - final public javax.measure.unit.Unit AddExpr() throws ParseException { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - Number n1 = null; - Token sign1 = null; - Number n2 = null; - Token sign2 = null; - if (jj_2_1(2147483647)) { - n1 = NumberExpr(); - sign1 = Sign(); - } else { - ; - } - result = MulExpr(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - sign2 = Sign(); - n2 = NumberExpr(); - break; - default: - jj_la1[1] = jj_gen; - ; - } - if (n1 != null) { - if (sign1.image.equals("-")) { - result = result.times(-1); - } - result = result.plus(n1.doubleValue()); - } - if (n2 != null) { - double offset = n2.doubleValue(); - if (sign2.image.equals("-")) { - offset = -offset; - } - result = result.plus(offset); - } - {if (true) return result;} - throw new Error("Missing return statement in function"); - } - - final public javax.measure.unit.Unit MulExpr() throws ParseException { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - javax.measure.unit.Unit temp = javax.measure.unit.Unit.ONE; - result = ExponentExpr(); - label_2: - while (true) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ASTERISK: - case MIDDLE_DOT: - case SOLIDUS: - ; - break; - default: - jj_la1[2] = jj_gen; - break label_2; - } - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ASTERISK: - case MIDDLE_DOT: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case ASTERISK: - jj_consume_token(ASTERISK); - break; - case MIDDLE_DOT: - jj_consume_token(MIDDLE_DOT); - break; - default: - jj_la1[3] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - temp = ExponentExpr(); - result=result.times(temp); - break; - case SOLIDUS: - jj_consume_token(SOLIDUS); - temp = ExponentExpr(); - result=result.divide(temp); - break; - default: - jj_la1[4] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - {if (true) return result;} - throw new Error("Missing return statement in function"); - } - - final public javax.measure.unit.Unit ExponentExpr() throws ParseException { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - javax.measure.unit.Unit temp = javax.measure.unit.Unit.ONE; - Exponent exponent = null; - Token token = null; - if (jj_2_2(2147483647)) { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INTEGER: - token = jj_consume_token(INTEGER); - break; - case E: - token = jj_consume_token(E); - break; - default: - jj_la1[5] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(CARET); - result = AtomicExpr(); - double base; - if (token.kind == INTEGER) { - base = Integer.parseInt(token.image); - } else { - base = StrictMath.E; - } - {if (true) return result.transform(new javax.measure.converter.LogConverter(base).inverse());} - } else { - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case OPEN_PAREN: - case INTEGER: - case FLOATING_POINT: - case UNIT_IDENTIFIER: - result = AtomicExpr(); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CARET: - case SUPERSCRIPT_INTEGER: - exponent = Exp(); - break; - default: - jj_la1[6] = jj_gen; - ; - } - if (exponent != null) { - if (exponent.pow != 1) { - result = result.pow(exponent.pow); - } - if (exponent.root != 1) { - result = result.root(exponent.root); - } - } - {if (true) return result;} - break; - case LOG: - case NAT_LOG: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case LOG: - jj_consume_token(LOG); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INTEGER: - token = jj_consume_token(INTEGER); - break; - default: - jj_la1[7] = jj_gen; - ; - } - break; - case NAT_LOG: - token = jj_consume_token(NAT_LOG); - break; - default: - jj_la1[8] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - jj_consume_token(OPEN_PAREN); - result = AddExpr(); - jj_consume_token(CLOSE_PAREN); - double base = 10; - if (token != null) { - if (token.kind == INTEGER) { - base = Integer.parseInt(token.image); - } else if (token.kind == NAT_LOG) { - base = StrictMath.E; - } - } - {if (true) return result.transform(new javax.measure.converter.LogConverter(base));} - break; - default: - jj_la1[9] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - } - throw new Error("Missing return statement in function"); - } - - final public javax.measure.unit.Unit AtomicExpr() throws ParseException { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - javax.measure.unit.Unit temp = javax.measure.unit.Unit.ONE; - Number n = null; - Token token = null; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INTEGER: - case FLOATING_POINT: - n = NumberExpr(); - if (n instanceof Integer) { - {if (true) return result.times(n.intValue());} - } else { - {if (true) return result.times(n.doubleValue());} - } - break; - case UNIT_IDENTIFIER: - token = jj_consume_token(UNIT_IDENTIFIER); - javax.measure.unit.Unit unit = _symbols.getUnit(token.image); - if (unit == null) { - Prefix prefix = _symbols.getPrefix(token.image); - if (prefix != null) { - String prefixSymbol = _symbols.getSymbol(prefix); - unit = _symbols.getUnit(token.image.substring(prefixSymbol.length())); - if (unit != null) { - {if (true) return unit.transform(prefix.getConverter());} - } - } - {if (true) throw new ParseException();} - } else { - {if (true) return unit;} - } - break; - case OPEN_PAREN: - jj_consume_token(OPEN_PAREN); - result = AddExpr(); - jj_consume_token(CLOSE_PAREN); - {if (true) return result;} - break; - default: - jj_la1[10] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - throw new Error("Missing return statement in function"); - } - - final public Token Sign() throws ParseException { - Token result = null; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - result = jj_consume_token(PLUS); - break; - case MINUS: - result = jj_consume_token(MINUS); - break; - default: - jj_la1[11] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - {if (true) return result;} - throw new Error("Missing return statement in function"); - } - - final public Number NumberExpr() throws ParseException { - Token token = null; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case INTEGER: - token = jj_consume_token(INTEGER); - {if (true) return Long.valueOf(token.image);} - break; - case FLOATING_POINT: - token = jj_consume_token(FLOATING_POINT); - {if (true) return Double.valueOf(token.image);} - break; - default: - jj_la1[12] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - throw new Error("Missing return statement in function"); - } - - final public Exponent Exp() throws ParseException { - Token powSign = null; - Token powToken = null; - Token rootSign = null; - Token rootToken = null; - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case CARET: - jj_consume_token(CARET); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - case INTEGER: - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - powSign = Sign(); - break; - default: - jj_la1[13] = jj_gen; - ; - } - powToken = jj_consume_token(INTEGER); - int pow = Integer.parseInt(powToken.image); - if ((powSign != null) && powSign.image.equals("-")) { - pow = -pow; - } - {if (true) return new Exponent(pow, 1);} - break; - case OPEN_PAREN: - jj_consume_token(OPEN_PAREN); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - powSign = Sign(); - break; - default: - jj_la1[14] = jj_gen; - ; - } - powToken = jj_consume_token(INTEGER); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case SOLIDUS: - jj_consume_token(SOLIDUS); - switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { - case PLUS: - case MINUS: - rootSign = Sign(); - break; - default: - jj_la1[15] = jj_gen; - ; - } - rootToken = jj_consume_token(INTEGER); - break; - default: - jj_la1[16] = jj_gen; - ; - } - jj_consume_token(CLOSE_PAREN); - pow = Integer.parseInt(powToken.image); - if ((powSign != null) && powSign.image.equals("-")) { - pow = -pow; - } - int root = 1; - if (rootToken != null) { - root = Integer.parseInt(rootToken.image); - if ((rootSign != null) && rootSign.image.equals("-")) { - root = -root; - } - } - {if (true) return new Exponent(pow, root);} - break; - default: - jj_la1[17] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - break; - case SUPERSCRIPT_INTEGER: - powToken = jj_consume_token(SUPERSCRIPT_INTEGER); - int pow = 0; - for (int i = 0; i < powToken.image.length(); i += 1) { - pow *= 10; - switch (powToken.image.charAt(i)) { - case '\u00b9': pow += 1; break; - case '\u00b2': pow += 2; break; - case '\u00b3': pow += 3; break; - case '\u2074': pow += 4; break; - case '\u2075': pow += 5; break; - case '\u2076': pow += 6; break; - case '\u2077': pow += 7; break; - case '\u2078': pow += 8; break; - case '\u2079': pow += 9; break; - } - } - {if (true) return new Exponent(pow, 1);} - break; - default: - jj_la1[18] = jj_gen; - jj_consume_token(-1); - throw new ParseException(); - } - throw new Error("Missing return statement in function"); - } - - private boolean jj_2_1(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_1(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(0, xla); } - } - - private boolean jj_2_2(int xla) { - jj_la = xla; jj_lastpos = jj_scanpos = token; - try { return !jj_3_2(); } - catch(LookaheadSuccess ls) { return true; } - finally { jj_save(1, xla); } - } - - private boolean jj_3R_3() { - Token xsp; - xsp = jj_scanpos; - if (jj_3R_5()) { - jj_scanpos = xsp; - if (jj_3R_6()) return true; - } - return false; - } - - private boolean jj_3R_6() { - if (jj_scan_token(FLOATING_POINT)) return true; - return false; - } - - private boolean jj_3_2() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(14)) { - jj_scanpos = xsp; - if (jj_scan_token(19)) return true; - } - if (jj_scan_token(CARET)) return true; - return false; - } - - private boolean jj_3_1() { - if (jj_3R_3()) return true; - if (jj_3R_4()) return true; - return false; - } - - private boolean jj_3R_4() { - Token xsp; - xsp = jj_scanpos; - if (jj_scan_token(5)) { - jj_scanpos = xsp; - if (jj_scan_token(6)) return true; - } - return false; - } - - private boolean jj_3R_5() { - if (jj_scan_token(INTEGER)) return true; - return false; - } - - /** Generated Token Manager. */ - public UnitParserTokenManager token_source; - SimpleCharStream jj_input_stream; - /** Current token. */ - public Token token; - /** Next token. */ - public Token jj_nt; - private int jj_ntk; - private Token jj_scanpos, jj_lastpos; - private int jj_la; - private int jj_gen; - final private int[] jj_la1 = new int[19]; - static private int[] jj_la1_0; - static { - jj_la1_init_0(); - } - private static void jj_la1_init_0() { - jj_la1_0 = new int[] {0x800,0x60,0x380,0x180,0x380,0x84000,0x8400,0x4000,0x60000,0x175000,0x115000,0x60,0x14000,0x60,0x60,0x60,0x200,0x5060,0x8400,}; - } - final private JJCalls[] jj_2_rtns = new JJCalls[2]; - private boolean jj_rescan = false; - private int jj_gc = 0; - - /** Constructor with InputStream. */ - public UnitParser(java.io.InputStream stream) { - this(stream, null); - } - /** Constructor with InputStream and supplied encoding */ - public UnitParser(java.io.InputStream stream, String encoding) { - try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } - token_source = new UnitParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 19; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream) { - ReInit(stream, null); - } - /** Reinitialise. */ - public void ReInit(java.io.InputStream stream, String encoding) { - try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); } - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 19; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor. */ - public UnitParser(java.io.Reader stream) { - jj_input_stream = new SimpleCharStream(stream, 1, 1); - token_source = new UnitParserTokenManager(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 19; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(java.io.Reader stream) { - jj_input_stream.ReInit(stream, 1, 1); - token_source.ReInit(jj_input_stream); - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 19; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Constructor with generated Token Manager. */ - public UnitParser(UnitParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 19; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - /** Reinitialise. */ - public void ReInit(UnitParserTokenManager tm) { - token_source = tm; - token = new Token(); - jj_ntk = -1; - jj_gen = 0; - for (int i = 0; i < 19; i++) jj_la1[i] = -1; - for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); - } - - private Token jj_consume_token(int kind) throws ParseException { - Token oldToken; - if ((oldToken = token).next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - if (token.kind == kind) { - jj_gen++; - if (++jj_gc > 100) { - jj_gc = 0; - for (int i = 0; i < jj_2_rtns.length; i++) { - JJCalls c = jj_2_rtns[i]; - while (c != null) { - if (c.gen < jj_gen) c.first = null; - c = c.next; - } - } - } - return token; - } - token = oldToken; - jj_kind = kind; - throw generateParseException(); - } - - static private final class LookaheadSuccess extends java.lang.Error { } - final private LookaheadSuccess jj_ls = new LookaheadSuccess(); - private boolean jj_scan_token(int kind) { - if (jj_scanpos == jj_lastpos) { - jj_la--; - if (jj_scanpos.next == null) { - jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken(); - } else { - jj_lastpos = jj_scanpos = jj_scanpos.next; - } - } else { - jj_scanpos = jj_scanpos.next; - } - if (jj_rescan) { - int i = 0; Token tok = token; - while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; } - if (tok != null) jj_add_error_token(kind, i); - } - if (jj_scanpos.kind != kind) return true; - if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls; - return false; - } - - -/** Get the next Token. */ - final public Token getNextToken() { - if (token.next != null) token = token.next; - else token = token.next = token_source.getNextToken(); - jj_ntk = -1; - jj_gen++; - return token; - } - -/** Get the specific Token. */ - final public Token getToken(int index) { - Token t = token; - for (int i = 0; i < index; i++) { - if (t.next != null) t = t.next; - else t = t.next = token_source.getNextToken(); - } - return t; - } - - private int jj_ntk() { - if ((jj_nt=token.next) == null) - return (jj_ntk = (token.next=token_source.getNextToken()).kind); - else - return (jj_ntk = jj_nt.kind); - } - - private java.util.List jj_expentries = new java.util.ArrayList(); - private int[] jj_expentry; - private int jj_kind = -1; - private int[] jj_lasttokens = new int[100]; - private int jj_endpos; - - private void jj_add_error_token(int kind, int pos) { - if (pos >= 100) return; - if (pos == jj_endpos + 1) { - jj_lasttokens[jj_endpos++] = kind; - } else if (jj_endpos != 0) { - jj_expentry = new int[jj_endpos]; - for (int i = 0; i < jj_endpos; i++) { - jj_expentry[i] = jj_lasttokens[i]; - } - jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) { - int[] oldentry = (int[])(it.next()); - if (oldentry.length == jj_expentry.length) { - for (int i = 0; i < jj_expentry.length; i++) { - if (oldentry[i] != jj_expentry[i]) { - continue jj_entries_loop; - } - } - jj_expentries.add(jj_expentry); - break jj_entries_loop; - } - } - if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind; - } - } - - /** Generate ParseException. */ - public ParseException generateParseException() { - jj_expentries.clear(); - boolean[] la1tokens = new boolean[21]; - if (jj_kind >= 0) { - la1tokens[jj_kind] = true; - jj_kind = -1; - } - for (int i = 0; i < 19; i++) { - if (jj_la1[i] == jj_gen) { - for (int j = 0; j < 32; j++) { - if ((jj_la1_0[i] & (1< jj_gen) { - jj_la = p.arg; jj_lastpos = jj_scanpos = p.first; - switch (i) { - case 0: jj_3_1(); break; - case 1: jj_3_2(); break; - } - } - p = p.next; - } while (p != null); - } catch(LookaheadSuccess ls) { } - } - jj_rescan = false; - } - - private void jj_save(int index, int xla) { - JJCalls p = jj_2_rtns[index]; - while (p.gen > jj_gen) { - if (p.next == null) { p = p.next = new JJCalls(); break; } - p = p.next; - } - p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla; - } - - static final class JJCalls { - int gen; - Token first; - int arg; - JJCalls next; - } - -} diff --git a/src/main/java/javax/measure/unit/format/UnitParserConstants.java b/src/main/java/javax/measure/unit/format/UnitParserConstants.java deleted file mode 100644 index 64b4127..0000000 --- a/src/main/java/javax/measure/unit/format/UnitParserConstants.java +++ /dev/null @@ -1,162 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/* Generated By:JavaCC: Do not edit this line. UnitParserConstants.java */ -package javax.measure.unit.format; - - -/** - * Token literal values and constants. - * Generated by org.javacc.parser.OtherFilesGen#start() - */ -public interface UnitParserConstants { - - /** End of File. */ - int EOF = 0; - /** RegularExpression Id. */ - int DIGIT = 1; - /** RegularExpression Id. */ - int SUPERSCRIPT_DIGIT = 2; - /** RegularExpression Id. */ - int INITIAL_CHAR = 3; - /** RegularExpression Id. */ - int EXTENDED_CHAR = 4; - /** RegularExpression Id. */ - int PLUS = 5; - /** RegularExpression Id. */ - int MINUS = 6; - /** RegularExpression Id. */ - int ASTERISK = 7; - /** RegularExpression Id. */ - int MIDDLE_DOT = 8; - /** RegularExpression Id. */ - int SOLIDUS = 9; - /** RegularExpression Id. */ - int CARET = 10; - /** RegularExpression Id. */ - int COLON = 11; - /** RegularExpression Id. */ - int OPEN_PAREN = 12; - /** RegularExpression Id. */ - int CLOSE_PAREN = 13; - /** RegularExpression Id. */ - int INTEGER = 14; - /** RegularExpression Id. */ - int SUPERSCRIPT_INTEGER = 15; - /** RegularExpression Id. */ - int FLOATING_POINT = 16; - /** RegularExpression Id. */ - int LOG = 17; - /** RegularExpression Id. */ - int NAT_LOG = 18; - /** RegularExpression Id. */ - int E = 19; - /** RegularExpression Id. */ - int UNIT_IDENTIFIER = 20; - - /** Lexical state. */ - int DEFAULT = 0; - - /** Literal token values. */ - String[] tokenImage = { - "", - "", - "", - "", - "", - "\"+\"", - "\"-\"", - "\"*\"", - "\"\\u00b7\"", - "\"/\"", - "\"^\"", - "\":\"", - "\"(\"", - "\")\"", - "", - "", - "", - "", - "", - "\"e\"", - "", - }; - -} diff --git a/src/main/java/javax/measure/unit/format/UnitParserTokenManager.java b/src/main/java/javax/measure/unit/format/UnitParserTokenManager.java deleted file mode 100644 index 484b9c1..0000000 --- a/src/main/java/javax/measure/unit/format/UnitParserTokenManager.java +++ /dev/null @@ -1,552 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/* Generated By:JavaCC: Do not edit this line. UnitParserTokenManager.java */ -package javax.measure.unit.format; - -/** Token Manager. */ -public class UnitParserTokenManager implements UnitParserConstants -{ - - /** Debug output. */ - public java.io.PrintStream debugStream = System.out; - /** Set debug output. */ - public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; } -private final int jjStopStringLiteralDfa_0(int pos, long active0) -{ - switch (pos) - { - default : - return -1; - } -} -private final int jjStartNfa_0(int pos, long active0) -{ - return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0), pos + 1); -} -private int jjStopAtPos(int pos, int kind) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - return pos + 1; -} -private int jjMoveStringLiteralDfa0_0() -{ - switch(curChar) - { - case 40: - return jjStopAtPos(0, 12); - case 41: - return jjStopAtPos(0, 13); - case 42: - return jjStopAtPos(0, 7); - case 43: - return jjStopAtPos(0, 5); - case 45: - return jjStopAtPos(0, 6); - case 47: - return jjStopAtPos(0, 9); - case 58: - return jjStopAtPos(0, 11); - case 94: - return jjStopAtPos(0, 10); - case 101: - return jjStartNfaWithStates_0(0, 19, 7); - case 183: - return jjStopAtPos(0, 8); - default : - return jjMoveNfa_0(6, 0); - } -} -private int jjStartNfaWithStates_0(int pos, int kind, int state) -{ - jjmatchedKind = kind; - jjmatchedPos = pos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return pos + 1; } - return jjMoveNfa_0(state, pos + 1); -} -static final long[] jjbitVec0 = { - 0x0L, 0x0L, 0x20c000000000000L, 0x0L -}; -static final long[] jjbitVec1 = { - 0x0L, 0x3f1000000000000L, 0x0L, 0x0L -}; -static final long[] jjbitVec2 = { - 0xfffffffefffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -static final long[] jjbitVec4 = { - 0x0L, 0x0L, 0xfd73ffffffffffffL, 0xffffffffffffffffL -}; -static final long[] jjbitVec5 = { - 0xffffffffffffffffL, 0xfc0effffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL -}; -private int jjMoveNfa_0(int startState, int curPos) -{ - int startsAt = 0; - jjnewStateCnt = 15; - int i = 1; - jjstateSet[0] = startState; - int kind = 0x7fffffff; - for (;;) - { - if (++jjround == 0x7fffffff) - ReInitRounds(); - if (curChar < 64) - { - long l = 1L << curChar; - do - { - switch(jjstateSet[--i]) - { - case 6: - if ((0xf80010fe00000000L & l) != 0L) - { - if (kind > 20) - kind = 20; - jjCheckNAdd(7); - } - else if ((0x3ff000000000000L & l) != 0L) - { - if (kind > 14) - kind = 14; - jjCheckNAddStates(0, 4); - } - else if (curChar == 46) - jjCheckNAdd(2); - break; - case 1: - if (curChar == 46) - jjCheckNAdd(2); - break; - case 2: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 16) - kind = 16; - jjCheckNAddTwoStates(2, 3); - break; - case 4: - if ((0x280000000000L & l) != 0L) - jjCheckNAdd(5); - break; - case 5: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 16) - kind = 16; - jjCheckNAdd(5); - break; - case 7: - if ((0xfbff10fe00000000L & l) == 0L) - break; - if (kind > 20) - kind = 20; - jjCheckNAdd(7); - break; - case 8: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 14) - kind = 14; - jjCheckNAddStates(0, 4); - break; - case 9: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 14) - kind = 14; - jjCheckNAdd(9); - break; - case 10: - if ((0x3ff000000000000L & l) == 0L) - break; - if (kind > 16) - kind = 16; - jjCheckNAddStates(5, 8); - break; - default : break; - } - } while(i != startsAt); - } - else if (curChar < 128) - { - long l = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 6: - if ((0xffffffffbfffffffL & l) != 0L) - { - if (kind > 20) - kind = 20; - jjCheckNAdd(7); - } - if (curChar == 108) - jjAddStates(9, 10); - break; - case 3: - if ((0x2000000020L & l) != 0L) - jjAddStates(11, 12); - break; - case 7: - if ((0xffffffffbfffffffL & l) == 0L) - break; - if (kind > 20) - kind = 20; - jjCheckNAdd(7); - break; - case 11: - if (curChar == 108) - jjAddStates(9, 10); - break; - case 12: - if (curChar == 111) - jjstateSet[jjnewStateCnt++] = 13; - break; - case 13: - if (curChar == 103 && kind > 17) - kind = 17; - break; - case 14: - if (curChar == 110 && kind > 18) - kind = 18; - break; - default : break; - } - } while(i != startsAt); - } - else - { - int hiByte = (int)(curChar >> 8); - int i1 = hiByte >> 6; - long l1 = 1L << (hiByte & 077); - int i2 = (curChar & 0xff) >> 6; - long l2 = 1L << (curChar & 077); - do - { - switch(jjstateSet[--i]) - { - case 6: - if (jjCanMove_0(hiByte, i1, i2, l1, l2)) - { - if (kind > 15) - kind = 15; - jjCheckNAdd(0); - } - if (jjCanMove_1(hiByte, i1, i2, l1, l2)) - { - if (kind > 20) - kind = 20; - jjCheckNAdd(7); - } - break; - case 0: - if (!jjCanMove_0(hiByte, i1, i2, l1, l2)) - break; - if (kind > 15) - kind = 15; - jjCheckNAdd(0); - break; - case 7: - if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) - break; - if (kind > 20) - kind = 20; - jjCheckNAdd(7); - break; - default : break; - } - } while(i != startsAt); - } - if (kind != 0x7fffffff) - { - jjmatchedKind = kind; - jjmatchedPos = curPos; - kind = 0x7fffffff; - } - ++curPos; - if ((i = jjnewStateCnt) == (startsAt = 15 - (jjnewStateCnt = startsAt))) - return curPos; - try { curChar = input_stream.readChar(); } - catch(java.io.IOException e) { return curPos; } - } -} -static final int[] jjnextStates = { - 9, 1, 2, 3, 10, 1, 2, 3, 10, 12, 14, 4, 5, -}; -private static final boolean jjCanMove_0(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 0: - return ((jjbitVec0[i2] & l2) != 0L); - case 32: - return ((jjbitVec1[i2] & l2) != 0L); - default : - return false; - } -} -private static final boolean jjCanMove_1(int hiByte, int i1, int i2, long l1, long l2) -{ - switch(hiByte) - { - case 0: - return ((jjbitVec4[i2] & l2) != 0L); - case 32: - return ((jjbitVec5[i2] & l2) != 0L); - default : - if ((jjbitVec2[i1] & l1) != 0L) - return true; - return false; - } -} - -/** Token literal values. */ -public static final String[] jjstrLiteralImages = { -"", null, null, null, null, "\53", "\55", "\52", "\267", "\57", "\136", "\72", -"\50", "\51", null, null, null, null, null, "\145", null, }; - -/** Lexer state names. */ -public static final String[] lexStateNames = { - "DEFAULT", -}; -protected SimpleCharStream input_stream; -private final int[] jjrounds = new int[15]; -private final int[] jjstateSet = new int[30]; -protected char curChar; -/** Constructor. */ -public UnitParserTokenManager(SimpleCharStream stream){ - if (SimpleCharStream.staticFlag) - throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer."); - input_stream = stream; -} - -/** Constructor. */ -public UnitParserTokenManager(SimpleCharStream stream, int lexState){ - this(stream); - SwitchTo(lexState); -} - -/** Reinitialise parser. */ -public void ReInit(SimpleCharStream stream) -{ - jjmatchedPos = jjnewStateCnt = 0; - curLexState = defaultLexState; - input_stream = stream; - ReInitRounds(); -} -private void ReInitRounds() -{ - int i; - jjround = 0x80000001; - for (i = 15; i-- > 0;) - jjrounds[i] = 0x80000000; -} - -/** Reinitialise parser. */ -public void ReInit(SimpleCharStream stream, int lexState) -{ - ReInit(stream); - SwitchTo(lexState); -} - -/** Switch to specified lex state. */ -public void SwitchTo(int lexState) -{ - if (lexState >= 1 || lexState < 0) - throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE); - else - curLexState = lexState; -} - -protected Token jjFillToken() -{ - final Token t; - final String curTokenImage; - final int beginLine; - final int endLine; - final int beginColumn; - final int endColumn; - String im = jjstrLiteralImages[jjmatchedKind]; - curTokenImage = (im == null) ? input_stream.GetImage() : im; - beginLine = input_stream.getBeginLine(); - beginColumn = input_stream.getBeginColumn(); - endLine = input_stream.getEndLine(); - endColumn = input_stream.getEndColumn(); - t = Token.newToken(jjmatchedKind, curTokenImage); - - t.beginLine = beginLine; - t.endLine = endLine; - t.beginColumn = beginColumn; - t.endColumn = endColumn; - - return t; -} - -int curLexState = 0; -int defaultLexState = 0; -int jjnewStateCnt; -int jjround; -int jjmatchedPos; -int jjmatchedKind; - -/** Get the next Token. */ -public Token getNextToken() -{ - Token matchedToken; - int curPos = 0; - - EOFLoop : - for (;;) - { - try - { - curChar = input_stream.BeginToken(); - } - catch(java.io.IOException e) - { - jjmatchedKind = 0; - matchedToken = jjFillToken(); - return matchedToken; - } - - jjmatchedKind = 0x7fffffff; - jjmatchedPos = 0; - curPos = jjMoveStringLiteralDfa0_0(); - if (jjmatchedKind != 0x7fffffff) - { - if (jjmatchedPos + 1 < curPos) - input_stream.backup(curPos - jjmatchedPos - 1); - matchedToken = jjFillToken(); - return matchedToken; - } - int error_line = input_stream.getEndLine(); - int error_column = input_stream.getEndColumn(); - String error_after = null; - boolean EOFSeen = false; - try { input_stream.readChar(); input_stream.backup(1); } - catch (java.io.IOException e1) { - EOFSeen = true; - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - if (curChar == '\n' || curChar == '\r') { - error_line++; - error_column = 0; - } - else - error_column++; - } - if (!EOFSeen) { - input_stream.backup(1); - error_after = curPos <= 1 ? "" : input_stream.GetImage(); - } - throw new TokenMgrError(EOFSeen, curLexState, error_line, error_column, error_after, curChar, TokenMgrError.LEXICAL_ERROR); - } -} - -private void jjCheckNAdd(int state) -{ - if (jjrounds[state] != jjround) - { - jjstateSet[jjnewStateCnt++] = state; - jjrounds[state] = jjround; - } -} -private void jjAddStates(int start, int end) -{ - do { - jjstateSet[jjnewStateCnt++] = jjnextStates[start]; - } while (start++ != end); -} -private void jjCheckNAddTwoStates(int state1, int state2) -{ - jjCheckNAdd(state1); - jjCheckNAdd(state2); -} - -private void jjCheckNAddStates(int start, int end) -{ - do { - jjCheckNAdd(jjnextStates[start]); - } while (start++ != end); -} - -} diff --git a/src/main/java/javax/measure/unit/format/package-info.java b/src/main/java/javax/measure/unit/format/package-info.java deleted file mode 100644 index 4658e1e..0000000 --- a/src/main/java/javax/measure/unit/format/package-info.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -/** - * Provides support for unit parsing and formatting. - * - * @author Jean-Marie Dautelle - * @version 1.0, April 15, 2009 - */ -package javax.measure.unit.format; diff --git a/src/main/javacc/javax/measure/unit/format/UCUMParser.jj b/src/main/javacc/javax/measure/unit/format/UCUMParser.jj deleted file mode 100644 index 654984b..0000000 --- a/src/main/javacc/javax/measure/unit/format/UCUMParser.jj +++ /dev/null @@ -1,190 +0,0 @@ -/* - * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences. - * Copyright (C) 2008-2009 - JScience - * All rights reserved. - * - * Permission to use, copy, modify, and distribute this software is - * freely granted, provided that this notice is preserved. - */ - -options { - STATIC = false; - DEBUG_PARSER = false; - DEBUG_LOOKAHEAD = false; - DEBUG_TOKEN_MANAGER = false; -} - -PARSER_BEGIN(UCUMParser) - -package javax.measure.unit.format; - -/** - *

- * Parser definition for parsing {@link javax.measure.unit.Unit Unit}s - * according to the - * Uniform Code for Units of Measure. - * - * @author Eric Russell - * @author Werner Keil - * @version 1.0.1 ($Revision: 39 $), $Date: 2009-10-18 20:35:52 +0200 (So, 18 Okt 2009) $ - * @see UCUM - */ -class UCUMParser { - - private SymbolMap _symbols; - - public UCUMParser (SymbolMap symbols, java.io.InputStream in) { - this(in); - _symbols = symbols; - } -} - -PARSER_END(UCUMParser) - -// -// Lexical entities -// - -TOKEN: { <#ATOM_CHAR: ["!","#"-"'","*",",","0"-"Z","\\","^"-"z","|","~"] > - | <#ESCAPED_ATOM_CHAR: ["!"-"Z","\\","^"-"~"] > - | <#TERMINAL_ATOM_CHAR: ["!","#"-"'","*",",",":"-"Z","\\","^"-"z","|","~"] > - | <#LCBRACKET: "{" > - | <#RCBRACKET: "}" > - | <#LSBRACKET: "[" > - | <#RSBRACKET: "]" > } -TOKEN: { (["!"-"z","|","~" ])* > } -TOKEN: { } -TOKEN: { } -TOKEN: { } -TOKEN: { } -TOKEN: { )* - ()+) | - (()* - ( ()+ ) - (()* - ()+)?)) > } - -// -// Parser productions -// - -javax.measure.unit.Unit parseUnit () : - { - javax.measure.unit.Unit u; - } -{ - u=Term() - { return u; } -} - -javax.measure.unit.Unit Term () : - { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - javax.measure.unit.Unit temp = javax.measure.unit.Unit.ONE; - } -{ -( - result=Component() - ( - ( temp=Component() { result = result.times(temp); }) - | - ( temp=Component() { result = result.divide(temp); }) - )* - { - return result; - } -) -} - -javax.measure.unit.Unit Component () : - { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - Token token = null; - } -{ -( - LOOKAHEAD(Annotatable() ) - result=Annotatable() token= - { - return new AnnotatedUnit(result, token.image.substring(1, token.image.length()-1)); - } -| - result=Annotatable() - { - return result; - } -| - token= - { - return new AnnotatedUnit(result, token.image.substring(1, token.image.length()-1)); - } -| - token= - { - long factor = Long.parseLong(token.image); - return result.times(factor); - } -| - result=Component() - { - return javax.measure.unit.Unit.ONE.divide(result); - } -| - "(" result=Term() ")" - { - return result; - } -) -} - -javax.measure.unit.Unit Annotatable () : - { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - Token token1 = null; - Token token2 = null; - } -{ -( - LOOKAHEAD(SimpleUnit() ()? ) - result=SimpleUnit() (token1=)? token2= - { - int exponent = Integer.parseInt(token2.image); - if ((token1 != null) && token1.image.equals("-")) { - return result.pow(-exponent); - } else { - return result.pow(exponent); - } - } -| - result=SimpleUnit() - { - return result; - } -) -} - -javax.measure.unit.Unit SimpleUnit () : - { - Token token = null; - } -{ -( - token= - { - javax.measure.unit.Unit unit = _symbols.getUnit(token.image); - if (unit == null) { - Prefix prefix = _symbols.getPrefix(token.image); - if (prefix != null) { - String prefixSymbol = _symbols.getSymbol(prefix); - unit = _symbols.getUnit(token.image.substring(prefixSymbol.length())); - if (unit != null) { - return unit.transform(prefix.getConverter()); - } - } - throw new ParseException(); - } else { - return unit; - } - } -) -} diff --git a/src/main/javacc/javax/measure/unit/format/UnitParser.jj b/src/main/javacc/javax/measure/unit/format/UnitParser.jj deleted file mode 100644 index 40618e2..0000000 --- a/src/main/javacc/javax/measure/unit/format/UnitParser.jj +++ /dev/null @@ -1,336 +0,0 @@ -/* - * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences. - * Copyright (C) 2008-2009 - JScience - * All rights reserved. - * - * Permission to use, copy, modify, and distribute this software is - * freely granted, provided that this notice is preserved. - */ - -options { - STATIC = false; - UNICODE_INPUT = true; - DEBUG_PARSER = false; - DEBUG_LOOKAHEAD = false; - DEBUG_TOKEN_MANAGER = false; -} - -PARSER_BEGIN(UnitParser) - -package javax.measure.unit.format; - -/** - * @author Eric Russell - * @author Werner Keil - * @version 1.0.1 ($Revision: 39 $), $Date: 2009-10-18 20:35:52 +0200 (So, 18 Okt 2009) $ - */ -class UnitParser { - - private static class Exponent { - public final int pow; - public final int root; - public Exponent (int pow, int root) { - this.pow = pow; - this.root = root; - } - } - - private SymbolMap _symbols; - - public UnitParser (SymbolMap symbols, java.io.Reader in) { - this(in); - _symbols = symbols; - } -} - -PARSER_END(UnitParser) - -// -// Lexical entities -// - -TOKEN: { <#DIGIT: [ "0","1","2","3","4","5","6","7","8","9" ] > - | <#SUPERSCRIPT_DIGIT: [ "\u2070", "\u00B9", "\u00B2", "\u00B3", "\u2074", "\u2075", "\u2076", "\u2077", "\u2078", "\u2079" ] > - | <#INITIAL_CHAR: ~["\u0000"-"\u0020", "(", ")", "*", "+", "-", ".", "/", "0"-"9", ":", "^", "\u00B2", "\u00B3", "\u00B7", "\u00B9", "\u2070", "\u2074", "\u2075", "\u2076", "\u2077", "\u2078", "\u2079" ] > - | <#EXTENDED_CHAR: ~["\u0000"-"\u0020", "(", ")", "*", "+", "-", ".", "/", ":", "^", "\u00B2", "\u00B3", "\u00B7", "\u00B9", "\u2070", "\u2074", "\u2075", "\u2076", "\u2077", "\u2078", "\u2079" ] > } -TOKEN: { } -TOKEN: { } -TOKEN: { } -TOKEN: { } -TOKEN: { } -TOKEN: { } -TOKEN: { } -TOKEN: { } -TOKEN: { } -TOKEN: { )+ > } -TOKEN: { )+ > } -TOKEN: { )* (".")? ()+ (("e" | "E") (()|())? ()+)? > } -TOKEN: { - | - | } -TOKEN: { ()* > } - -// -// Parser productions -// - -javax.measure.unit.Unit parseUnit () : - { - javax.measure.unit.Unit result; - } -{ - result=CompoundExpr() - { - return result; - } -} - -javax.measure.unit.Unit CompoundExpr () : - { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - javax.measure.unit.Unit temp = javax.measure.unit.Unit.ONE; - } -{ -( - result=AddExpr() - ( - temp=AddExpr() { result=result.compound(temp); } - )* - { return result; } -) -} - -javax.measure.unit.Unit AddExpr () : - { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - Number n1 = null; - Token sign1 = null; - Number n2 = null; - Token sign2 = null; - } -{ -( - ( LOOKAHEAD(NumberExpr() Sign()) n1=NumberExpr() sign1=Sign() )? - result=MulExpr() - ( sign2=Sign() n2=NumberExpr() )? - { - if (n1 != null) { - if (sign1.image.equals("-")) { - result = result.times(-1); - } - result = result.plus(n1.doubleValue()); - } - if (n2 != null) { - double offset = n2.doubleValue(); - if (sign2.image.equals("-")) { - offset = -offset; - } - result = result.plus(offset); - } - return result; - } -) -} - -javax.measure.unit.Unit MulExpr () : - { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - javax.measure.unit.Unit temp = javax.measure.unit.Unit.ONE; - } -{ -( - result=ExponentExpr() - ( - ( ( | ) temp=ExponentExpr() { result=result.times(temp); } ) - | - ( temp=ExponentExpr() { result=result.divide(temp); } ) - )* - { return result; } -) -} - -javax.measure.unit.Unit ExponentExpr () : - { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - javax.measure.unit.Unit temp = javax.measure.unit.Unit.ONE; - Exponent exponent = null; - Token token = null; - } -{ -( - LOOKAHEAD(( | ) ) - ( ((token=) | token=) result=AtomicExpr() ) - { - double base; - if (token.kind == INTEGER) { - base = Integer.parseInt(token.image); - } else { - base = StrictMath.E; - } - return result.transform(new javax.measure.converter.LogConverter(base).inverse()); - } -| - ( result=AtomicExpr() ( exponent=Exp() )? ) - { - if (exponent != null) { - if (exponent.pow != 1) { - result = result.pow(exponent.pow); - } - if (exponent.root != 1) { - result = result.root(exponent.root); - } - } - return result; - } -| - ( ( ( (token=)? ) | token= ) result=AddExpr() ) - { - double base = 10; - if (token != null) { - if (token.kind == INTEGER) { - base = Integer.parseInt(token.image); - } else if (token.kind == NAT_LOG) { - base = StrictMath.E; - } - } - return result.transform(new javax.measure.converter.LogConverter(base)); - } -) -} - -javax.measure.unit.Unit AtomicExpr () : - { - javax.measure.unit.Unit result = javax.measure.unit.Unit.ONE; - javax.measure.unit.Unit temp = javax.measure.unit.Unit.ONE; - Number n = null; - Token token = null; - } -{ -( - ( n=NumberExpr() ) - { - if (n instanceof Integer) { - return result.times(n.intValue()); - } else { - return result.times(n.doubleValue()); - } - } -| - ( token= ) - { - javax.measure.unit.Unit unit = _symbols.getUnit(token.image); - if (unit == null) { - Prefix prefix = _symbols.getPrefix(token.image); - if (prefix != null) { - String prefixSymbol = _symbols.getSymbol(prefix); - unit = _symbols.getUnit(token.image.substring(prefixSymbol.length())); - if (unit != null) { - return unit.transform(prefix.getConverter()); - } - } - throw new ParseException(); - } else { - return unit; - } - } -| - ( result=AddExpr() ) - { - return result; - } -) -} - -Token Sign () : - { - Token result = null; - } -{ -( - (result=) -| - (result=) -) - { - return result; - } -} - -Number NumberExpr () : - { - Token token = null; - } -{ -( - ( token= ) - { - return Long.valueOf(token.image); - } -| - ( token= ) - { - return Double.valueOf(token.image); - } -) -} - -Exponent Exp () : - { - Token powSign = null; - Token powToken = null; - Token rootSign = null; - Token rootToken = null; - } -{ -( - ( - - ( - ( (powSign=Sign())? powToken= ) - { - int pow = Integer.parseInt(powToken.image); - if ((powSign != null) && powSign.image.equals("-")) { - pow = -pow; - } - return new Exponent(pow, 1); - } - | - ( (powSign=Sign())? powToken= ( (rootSign=Sign())? rootToken= )? ) - { - pow = Integer.parseInt(powToken.image); - if ((powSign != null) && powSign.image.equals("-")) { - pow = -pow; - } - int root = 1; - if (rootToken != null) { - root = Integer.parseInt(rootToken.image); - if ((rootSign != null) && rootSign.image.equals("-")) { - root = -root; - } - } - return new Exponent(pow, root); - } - ) - ) -| - ( powToken= ) - { - int pow = 0; - for (int i = 0; i < powToken.image.length(); i += 1) { - pow *= 10; - switch (powToken.image.charAt(i)) { - case '\u00B9': pow += 1; break; - case '\u00B2': pow += 2; break; - case '\u00B3': pow += 3; break; - case '\u2074': pow += 4; break; - case '\u2075': pow += 5; break; - case '\u2076': pow += 6; break; - case '\u2077': pow += 7; break; - case '\u2078': pow += 8; break; - case '\u2079': pow += 9; break; - } - } - return new Exponent(pow, 1); - } -) -} diff --git a/src/main/javadoc/javax/measure/converter/doc-files/converter.png b/src/main/javadoc/javax/measure/converter/doc-files/converter.png deleted file mode 100644 index 4a2fdba..0000000 Binary files a/src/main/javadoc/javax/measure/converter/doc-files/converter.png and /dev/null differ diff --git a/src/main/javadoc/javax/measure/converter/package.html b/src/main/javadoc/javax/measure/converter/package.html deleted file mode 100644 index 5e2b5b0..0000000 --- a/src/main/javadoc/javax/measure/converter/package.html +++ /dev/null @@ -1,87 +0,0 @@ - - -

Provides support for unit conversion.

-

UML Diagram

- UML Diagram - \ No newline at end of file diff --git a/src/main/javadoc/javax/measure/unit/format/package.html b/src/main/javadoc/javax/measure/unit/format/package.html deleted file mode 100644 index 5572deb..0000000 --- a/src/main/javadoc/javax/measure/unit/format/package.html +++ /dev/null @@ -1,85 +0,0 @@ - - -

Provides support for unit parsing and formatting.

- \ No newline at end of file diff --git a/src/main/resources/javax/measure/unit/format/LocalFormat.properties b/src/main/resources/javax/measure/unit/format/LocalFormat.properties deleted file mode 100644 index e392a5e..0000000 --- a/src/main/resources/javax/measure/unit/format/LocalFormat.properties +++ /dev/null @@ -1,525 +0,0 @@ -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 4, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 3, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 18, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 04, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# NOTE: as a Java properties file, this file must use the -# ISO 8859-1 encoding, so all non-ASCII Unicode characters -# must be escaped using the \uXXXX syntax. -# See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding - -# SI Prefixes - -javax.measure.unit.format.Prefix.YOTTA=Y -javax.measure.unit.format.Prefix.ZETTA=Z -javax.measure.unit.format.Prefix.EXA=E -javax.measure.unit.format.Prefix.PETA=P -javax.measure.unit.format.Prefix.TERA=T -javax.measure.unit.format.Prefix.GIGA=G -javax.measure.unit.format.Prefix.MEGA=M -javax.measure.unit.format.Prefix.KILO=k -javax.measure.unit.format.Prefix.HECTO=h -javax.measure.unit.format.Prefix.DEKA=da -javax.measure.unit.format.Prefix.DECI=d -javax.measure.unit.format.Prefix.CENTI=c -javax.measure.unit.format.Prefix.MILLI=m -javax.measure.unit.format.Prefix.MICRO=\u00B5 -javax.measure.unit.format.Prefix.NANO=n -javax.measure.unit.format.Prefix.PICO=p -javax.measure.unit.format.Prefix.FEMTO=f -javax.measure.unit.format.Prefix.ATTO=a -javax.measure.unit.format.Prefix.ZEPTO=z -javax.measure.unit.format.Prefix.YOCTO=y - -# SI Units - -javax.measure.unit.SI.AMPERE=A -javax.measure.unit.SI.AMPERE_TURN=At -javax.measure.unit.SI.BECQUEREL=Bq -javax.measure.unit.SI.CANDELA=cd -javax.measure.unit.SI.CELSIUS=\u00B0C -javax.measure.unit.SI.CELSIUS.1=\u2103 -javax.measure.unit.SI.CELSIUS.2=Celsius -javax.measure.unit.SI.COULOMB=C -javax.measure.unit.SI.FARAD=F -javax.measure.unit.SI.GRAM=g -javax.measure.unit.SI.GRAY=Gy -javax.measure.unit.SI.HENRY=H -javax.measure.unit.SI.HERTZ=Hz -javax.measure.unit.SI.JOULE=J -javax.measure.unit.SI.KATAL=kat -javax.measure.unit.SI.KELVIN=K -javax.measure.unit.SI.LUMEN=lm -javax.measure.unit.SI.LUX=lx -javax.measure.unit.SI.METRE=m -javax.measure.unit.SI.MOLE=mol -javax.measure.unit.SI.NEWTON=N -javax.measure.unit.SI.OHM=\u03A9 -javax.measure.unit.SI.PASCAL=Pa -javax.measure.unit.SI.RADIAN=rad -javax.measure.unit.SI.SECOND=s -javax.measure.unit.SI.SIEMENS=S -javax.measure.unit.SI.SIEVERT=Sv -javax.measure.unit.SI.STERADIAN=sr -javax.measure.unit.SI.TESLA=T -javax.measure.unit.SI.VOLT=V -javax.measure.unit.SI.WATT=W -javax.measure.unit.SI.WEBER=Wb - -# Non-SI Units - -javax.measure.unit.NonSI.PERCENT=% -javax.measure.unit.NonSI.DECIBEL=dB -javax.measure.unit.NonSI.G=grav -javax.measure.unit.NonSI.ATOM=atom -javax.measure.unit.NonSI.REVOLUTION=rev -javax.measure.unit.NonSI.DEGREE_ANGLE=\u00B0 -javax.measure.unit.NonSI.MINUTE_ANGLE=' -javax.measure.unit.NonSI.SECOND_ANGLE=" -javax.measure.unit.NonSI.CENTIRADIAN=centiradian -javax.measure.unit.NonSI.GRADE=grade -javax.measure.unit.NonSI.ARE=a -javax.measure.unit.NonSI.HECTARE=ha -javax.measure.unit.NonSI.BYTE=byte -javax.measure.unit.NonSI.MINUTE=min -javax.measure.unit.NonSI.HOUR=h -javax.measure.unit.NonSI.DAY=day -javax.measure.unit.NonSI.WEEK=week -javax.measure.unit.NonSI.DAY_SIDEREAL=day_sidereal -javax.measure.unit.NonSI.YEAR_SIDEREAL=year_sidereal -javax.measure.unit.NonSI.YEAR_CALENDAR=year -javax.measure.unit.NonSI.E=e -javax.measure.unit.NonSI.FARADAY=Fd -javax.measure.unit.NonSI.FRANKLIN=Fr -javax.measure.unit.NonSI.GILBERT=Gi -javax.measure.unit.NonSI.ERG=erg -javax.measure.unit.NonSI.ELECTRON_VOLT=eV -javax.measure.unit.NonSI.LAMBERT=La -javax.measure.unit.NonSI.FOOT=ft -javax.measure.unit.NonSI.FOOT_SURVEY_US=foot_survey_us -javax.measure.unit.NonSI.YARD=yd -javax.measure.unit.NonSI.INCH=in -javax.measure.unit.NonSI.MILE=mi -javax.measure.unit.NonSI.NAUTICAL_MILE=nmi -javax.measure.unit.NonSI.MILES_PER_HOUR=mph -javax.measure.unit.NonSI.ANGSTROM=\u00C5 -javax.measure.unit.NonSI.ASTRONOMICAL_UNIT=ua -javax.measure.unit.NonSI.LIGHT_YEAR=ly -javax.measure.unit.NonSI.PARSEC=pc -javax.measure.unit.NonSI.POINT=pt -javax.measure.unit.NonSI.PIXEL=pixel -javax.measure.unit.NonSI.MAXWELL=Mx -javax.measure.unit.NonSI.GAUSS=G -javax.measure.unit.NonSI.ATOMIC_MASS=u -javax.measure.unit.NonSI.ELECTRON_MASS=me -javax.measure.unit.NonSI.POUND=lb -javax.measure.unit.NonSI.OUNCE=oz -javax.measure.unit.NonSI.TON_US=ton_us -javax.measure.unit.NonSI.TON_UK=ton_uk -javax.measure.unit.NonSI.METRIC_TON=t -javax.measure.unit.NonSI.DYNE=dyn -javax.measure.unit.NonSI.KILOGRAM_FORCE=kgf -javax.measure.unit.NonSI.POUND_FORCE=lbf -javax.measure.unit.NonSI.HORSEPOWER=hp -javax.measure.unit.NonSI.ATMOSPHERE=atm -javax.measure.unit.NonSI.BAR=bar -javax.measure.unit.NonSI.MILLIMETRE_OF_MERCURY=mmHg -javax.measure.unit.NonSI.INCH_OF_MERCURY=inHg -javax.measure.unit.NonSI.RAD=rd -javax.measure.unit.NonSI.REM=rem -javax.measure.unit.NonSI.CURIE=Ci -javax.measure.unit.NonSI.RUTHERFORD=Rd -javax.measure.unit.NonSI.SPHERE=sphere -javax.measure.unit.NonSI.RANKINE=\u00B0R -javax.measure.unit.NonSI.FAHRENHEIT=\u00B0F -javax.measure.unit.NonSI.FAHRENHEIT.1=\u2109 -javax.measure.unit.NonSI.KNOT=kn -javax.measure.unit.NonSI.C=c -javax.measure.unit.NonSI.LITRE=L -javax.measure.unit.NonSI.GALLON_LIQUID_US=gal -javax.measure.unit.NonSI.OUNCE_LIQUID_US=oz -javax.measure.unit.NonSI.GALLON_DRY_US=gallon_dry_us -javax.measure.unit.NonSI.GALLON_UK=gallon_uk -javax.measure.unit.NonSI.OUNCE_LIQUID_UK=oz_uk -javax.measure.unit.NonSI.ROENTGEN=fps -javax.measure.unit.NonSI.ROENTGEN=Roentgen -javax.measure.unit.NonSI.PI=\u03C0 diff --git a/src/main/resources/javax/measure/unit/format/LocalFormat_de.properties b/src/main/resources/javax/measure/unit/format/LocalFormat_de.properties deleted file mode 100644 index 2ee3c0c..0000000 --- a/src/main/resources/javax/measure/unit/format/LocalFormat_de.properties +++ /dev/null @@ -1,405 +0,0 @@ -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 4, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 3, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 18, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 04, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -#Generated by ResourceBundle Editor (http://eclipse-rbe.sourceforge.net) -#$Id: LocalFormat_de.properties 76 2009-12-03 22:53:52Z keilw $ -javax.measure.unit.NonSI.DAY = tag -javax.measure.unit.NonSI.DAY_SIDEREAL = tag_sidereal -javax.measure.unit.NonSI.FOOT_SURVEY_US = fu\u00DF_survey_us -javax.measure.unit.NonSI.GALLON_DRY_US = gallone_trocken_us -javax.measure.unit.NonSI.GALLON_UK = gallone_uk -javax.measure.unit.NonSI.GRADE = grad -javax.measure.unit.NonSI.HORSEPOWER = ps -javax.measure.unit.NonSI.LIGHT_YEAR = lj -javax.measure.unit.NonSI.MILES_PER_HOUR = mps -javax.measure.unit.NonSI.OUNCE = uz -javax.measure.unit.NonSI.OUNCE_LIQUID_UK = uz_uk -javax.measure.unit.NonSI.OUNCE_LIQUID_US = uz -javax.measure.unit.NonSI.POINT = pkt -javax.measure.unit.NonSI.ROENTGEN = R\u00F6ntgen -javax.measure.unit.NonSI.TON_UK = tonne_uk -javax.measure.unit.NonSI.TON_US = tonne_us -javax.measure.unit.NonSI.WEEK = woche -javax.measure.unit.NonSI.YEAR_CALENDAR = jahr -javax.measure.unit.NonSI.YEAR_SIDEREAL = jahr_sidereal diff --git a/src/main/resources/javax/measure/unit/format/LocalFormat_en_GB.properties b/src/main/resources/javax/measure/unit/format/LocalFormat_en_GB.properties deleted file mode 100644 index c75f0ce..0000000 --- a/src/main/resources/javax/measure/unit/format/LocalFormat_en_GB.properties +++ /dev/null @@ -1,388 +0,0 @@ -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 4, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 3, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 18, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 04, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -javax.measure.unit.NonSI.GALLON_UK=gal -javax.measure.unit.NonSI.OUNCE_LIQUID_UK=oz -javax.measure.unit.NonSI.GALLON_LIQUID_US=gal_us -javax.measure.unit.NonSI.OUNCE_LIQUID_US=oz_us diff --git a/src/main/resources/javax/measure/unit/format/UCUMFormat_CI.properties b/src/main/resources/javax/measure/unit/format/UCUMFormat_CI.properties deleted file mode 100644 index a2a09cd..0000000 --- a/src/main/resources/javax/measure/unit/format/UCUMFormat_CI.properties +++ /dev/null @@ -1,635 +0,0 @@ -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 4, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 3, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 18, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 04, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# $Id: UCUMFormat_CI.properties 76 2009-12-03 22:53:52Z keilw $ - -# Prefixes - -javax.measure.unit.format.Prefix.YOTTA=YA -javax.measure.unit.format.Prefix.ZETTA=ZA -javax.measure.unit.format.Prefix.EXA=EX -javax.measure.unit.format.Prefix.PETA=PT -javax.measure.unit.format.Prefix.TERA=TR -javax.measure.unit.format.Prefix.GIGA=GA -javax.measure.unit.format.Prefix.MEGA=MA -javax.measure.unit.format.Prefix.KILO=K -javax.measure.unit.format.Prefix.HECTO=H -javax.measure.unit.format.Prefix.DEKA=DA -javax.measure.unit.format.Prefix.DECI=D -javax.measure.unit.format.Prefix.CENTI=C -javax.measure.unit.format.Prefix.MILLI=M -javax.measure.unit.format.Prefix.MICRO=U -javax.measure.unit.format.Prefix.NANO=N -javax.measure.unit.format.Prefix.PICO=P -javax.measure.unit.format.Prefix.FEMTO=F -javax.measure.unit.format.Prefix.ATTO=A -javax.measure.unit.format.Prefix.ZEPTO=ZO -javax.measure.unit.format.Prefix.YOCTO=YO - -# Units - -javax.measure.unit.UCUM.METER=M -javax.measure.unit.UCUM.SECOND=S -javax.measure.unit.UCUM.GRAM=G -javax.measure.unit.UCUM.AMPERE_TURN=AT -javax.measure.unit.UCUM.RADIAN=RAD -javax.measure.unit.UCUM.KELVIN=K -javax.measure.unit.UCUM.COULOMB=C -javax.measure.unit.UCUM.CANDELA=CD -javax.measure.unit.UCUM.TRIILLIONS=10^12 -javax.measure.unit.UCUM.BILLIONS=10^9 -javax.measure.unit.UCUM.MILLIONS=10^6 -javax.measure.unit.UCUM.THOUSANDS=10^3 -javax.measure.unit.UCUM.HUNDREDS=10^2 -javax.measure.unit.UCUM.PI=[PI] -javax.measure.unit.UCUM.PERCENT=% -javax.measure.unit.UCUM.PER_THOUSAND=[PPTH] -javax.measure.unit.UCUM.PER_MILLION=[PPM] -javax.measure.unit.UCUM.PER_BILLION=[PPB] -javax.measure.unit.UCUM.PER_TRILLION=[PPTR] -javax.measure.unit.UCUM.MOLE=MOL -javax.measure.unit.UCUM.STERADIAN=SR -javax.measure.unit.UCUM.HERTZ=HZ -javax.measure.unit.UCUM.NEWTON=N -javax.measure.unit.UCUM.PASCAL=PAL -javax.measure.unit.UCUM.JOULE=J -javax.measure.unit.UCUM.WATT=W -javax.measure.unit.UCUM.AMPERE=A -javax.measure.unit.UCUM.VOLT=V -javax.measure.unit.UCUM.FARAD=F -javax.measure.unit.UCUM.OHM=OHM -javax.measure.unit.UCUM.SIEMENS=SIE -javax.measure.unit.UCUM.WEBER=WB -javax.measure.unit.UCUM.CELSIUS=CEL -javax.measure.unit.UCUM.TESLA=T -javax.measure.unit.UCUM.HENRY=H -javax.measure.unit.UCUM.LUMEN=LM -javax.measure.unit.UCUM.LUX=LX -javax.measure.unit.UCUM.BECQUEREL=BQ -javax.measure.unit.UCUM.GRAY=GY -javax.measure.unit.UCUM.SIEVERT=SV -javax.measure.unit.UCUM.DEGREE=DEG -javax.measure.unit.UCUM.GRADE=GON -javax.measure.unit.UCUM.MINUTE_ANGLE=' -javax.measure.unit.UCUM.SECOND_ANGLE='' -javax.measure.unit.UCUM.LITER=L -javax.measure.unit.UCUM.ARE=AR -javax.measure.unit.UCUM.MINUTE=MIN -javax.measure.unit.UCUM.HOUR=HR -javax.measure.unit.UCUM.DAY=D -javax.measure.unit.UCUM.YEAR_TROPICAL=ANN_T -javax.measure.unit.UCUM.YEAR_JULIAN=ANN_J -javax.measure.unit.UCUM.YEAR_GREGORIAN=ANN_G -javax.measure.unit.UCUM.YEAR=ANN -javax.measure.unit.UCUM.MONTH_SYNODAL=MO_S -javax.measure.unit.UCUM.MONTH_JULIAN=MO_J -javax.measure.unit.UCUM.MONTH_GREGORIAN=MO_G -javax.measure.unit.UCUM.MONTH=MO -javax.measure.unit.UCUM.TONNE=TNE -javax.measure.unit.UCUM.BAR=BAR -javax.measure.unit.UCUM.ATOMIC_MASS_UNIT=AMU -javax.measure.unit.UCUM.ELECTRON_VOLT=EV -javax.measure.unit.UCUM.ASTRONOMIC_UNIT=ASU -javax.measure.unit.UCUM.PARSEC=PRS -javax.measure.unit.UCUM.C=[C] -javax.measure.unit.UCUM.PLANCK=[H] -javax.measure.unit.UCUM.BOLTZMAN=[K] -javax.measure.unit.UCUM.PERMITTIVITY_OF_VACUUM=[EPS_0] -javax.measure.unit.UCUM.PERMEABILITY_OF_VACUUM=[MU_0] -javax.measure.unit.UCUM.ELEMENTARY_CHARGE=[E] -javax.measure.unit.UCUM.ELECTRON_MASS=[M_E] -javax.measure.unit.UCUM.PROTON_MASS=[M_P] -javax.measure.unit.UCUM.NEWTON_CONSTANT_OF_GRAVITY=[GC] -javax.measure.unit.UCUM.ACCELLERATION_OF_FREEFALL=[G] -javax.measure.unit.UCUM.ATMOSPHERE=ATM -javax.measure.unit.UCUM.LIGHT_YEAR=[LY] -javax.measure.unit.UCUM.GRAM_FORCE=GF -javax.measure.unit.UCUM.KAYSER=KY -javax.measure.unit.UCUM.GAL=GL -javax.measure.unit.UCUM.DYNE=DYN -javax.measure.unit.UCUM.ERG=ERG -javax.measure.unit.UCUM.POISE=P -javax.measure.unit.UCUM.BIOT=BI -javax.measure.unit.UCUM.STOKES=ST -javax.measure.unit.UCUM.MAXWELL=MX -javax.measure.unit.UCUM.GAUSS=GS -javax.measure.unit.UCUM.OERSTED=OE -javax.measure.unit.UCUM.GILBERT=GB -javax.measure.unit.UCUM.STILB=SB -javax.measure.unit.UCUM.LAMBERT=LMB -javax.measure.unit.UCUM.PHOT=PHT -javax.measure.unit.UCUM.CURIE=CI -javax.measure.unit.UCUM.ROENTGEN=ROE -javax.measure.unit.UCUM.RAD=[RAD] -javax.measure.unit.UCUM.REM=[REM] -javax.measure.unit.UCUM.INCH_INTERNATIONAL=[IN_I] -javax.measure.unit.UCUM.FOOT_INTERNATIONAL=[FT_I] -javax.measure.unit.UCUM.YARD_INTERNATIONAL=[YD_I] -javax.measure.unit.UCUM.MILE_INTERNATIONAL=[MI_I] -javax.measure.unit.UCUM.FATHOM_INTERNATIONAL=[FTH_I] -javax.measure.unit.UCUM.NAUTICAL_MILE_INTERNATIONAL=[NMI_I] -javax.measure.unit.UCUM.KNOT_INTERNATIONAL=[KN_I] -javax.measure.unit.UCUM.SQUARE_INCH_INTERNATIONAL=[SIN_I] -javax.measure.unit.UCUM.SQUARE_FOOT_INTERNATIONAL=[SFT_I] -javax.measure.unit.UCUM.SQUARE_YARD_INTERNATIONAL=[SYD_I] -javax.measure.unit.UCUM.CUBIC_INCH_INTERNATIONAL=[CIN_I] -javax.measure.unit.UCUM.CUBIC_FOOT_INTERNATIONAL=[CFT_I] -javax.measure.unit.UCUM.CUBIC_YARD_INTERNATIONAL=[CYD_I] -javax.measure.unit.UCUM.BOARD_FOOT_INTERNATIONAL=[BF_I] -javax.measure.unit.UCUM.CORD_INTERNATIONAL=[CR_I] -javax.measure.unit.UCUM.MIL_INTERNATIONAL=[MIL_I] -javax.measure.unit.UCUM.CIRCULAR_MIL_INTERNATIONAL=[CML_I] -javax.measure.unit.UCUM.HAND_INTERNATIONAL=[HD_I] -javax.measure.unit.UCUM.FOOT_US_SURVEY=[FT_US] -javax.measure.unit.UCUM.YARD_US_SURVEY=[YD_US] -javax.measure.unit.UCUM.INCH_US_SURVEY=[IN_US] -javax.measure.unit.UCUM.ROD_US_SURVEY=[RD_US] -javax.measure.unit.UCUM.CHAIN_US_SURVEY=[CH_US] -javax.measure.unit.UCUM.LINK_US_SURVEY=[LK_US] -javax.measure.unit.UCUM.RAMDEN_CHAIN_US_SURVEY=[RCH_US] -javax.measure.unit.UCUM.RAMDEN_LINK_US_SURVEY=[RLK_US] -javax.measure.unit.UCUM.FATHOM_US_SURVEY=[FTH_US] -javax.measure.unit.UCUM.FURLONG_US_SURVEY=[FUR_US] -javax.measure.unit.UCUM.MILE_US_SURVEY=[MI_US] -javax.measure.unit.UCUM.ACRE_US_SURVEY=[ACR_US] -javax.measure.unit.UCUM.SQUARE_ROD_US_SURVEY=[SRD_US] -javax.measure.unit.UCUM.SQUARE_MILE_US_SURVEY=[SMI_US] -javax.measure.unit.UCUM.SECTION_US_SURVEY=[SCT] -javax.measure.unit.UCUM.TOWNSHP_US_SURVEY=[TWP] -javax.measure.unit.UCUM.MIL_US_SURVEY=[MIL_US] -javax.measure.unit.UCUM.INCH_BRITISH=[IN_BR] -javax.measure.unit.UCUM.FOOT_BRITISH=[FT_BR] -javax.measure.unit.UCUM.ROD_BRITISH=[RD_BR] -javax.measure.unit.UCUM.CHAIN_BRITISH=[CH_BR] -javax.measure.unit.UCUM.LINK_BRITISH=[LK_BR] -javax.measure.unit.UCUM.FATHOM_BRITISH=[FTH_BR] -javax.measure.unit.UCUM.PACE_BRITISH=[PC_BR] -javax.measure.unit.UCUM.YARD_BRITISH=[YD_BR] -javax.measure.unit.UCUM.MILE_BRITISH=[MI_BR] -javax.measure.unit.UCUM.NAUTICAL_MILE_BRITISH=[NMI_BR] -javax.measure.unit.UCUM.KNOT_BRITISH=[KN_BR] -javax.measure.unit.UCUM.ACRE_BRITISH=[ACR_BR] -javax.measure.unit.UCUM.GALLON_US=[GAL_US] -javax.measure.unit.UCUM.BARREL_US=[BBL_US] -javax.measure.unit.UCUM.QUART_US=[QT_US] -javax.measure.unit.UCUM.PINT_US=[PT_US] -javax.measure.unit.UCUM.GILL_US=[GIL_US] -javax.measure.unit.UCUM.FLUID_OUNCE_US=[FOZ_US] -javax.measure.unit.UCUM.FLUID_DRAM_US=[FDR_US] -javax.measure.unit.UCUM.MINIM_US=[MIN_US] -javax.measure.unit.UCUM.CORD_US=[CRD_US] -javax.measure.unit.UCUM.BUSHEL_US=[BU_US] -javax.measure.unit.UCUM.GALLON_WINCHESTER=[GAL_WI] -javax.measure.unit.UCUM.PECK_US=[PK_US] -javax.measure.unit.UCUM.DRY_QUART_US=[DQT_US] -javax.measure.unit.UCUM.DRY_PINT_US=[DPT_US] -javax.measure.unit.UCUM.TABLESPOON_US=[TBS_US] -javax.measure.unit.UCUM.TEASPOON_US=[TSP_US] -javax.measure.unit.UCUM.CUP_US=[CUP_US] -javax.measure.unit.UCUM.GALLON_BRITISH=[GAL_BR] -javax.measure.unit.UCUM.PECK_BRITISH=[PK_BR] -javax.measure.unit.UCUM.BUSHEL_BRITISH=[BU_BR] -javax.measure.unit.UCUM.QUART_BRITISH=[QT_BR] -javax.measure.unit.UCUM.PINT_BRITISH=[PT_BR] -javax.measure.unit.UCUM.GILL_BRITISH=[GIL_BR] -javax.measure.unit.UCUM.FLUID_OUNCE_BRITISH=[FOZ_BR] -javax.measure.unit.UCUM.FLUID_DRAM_BRITISH=[FDR_BR] -javax.measure.unit.UCUM.MINIM_BRITISH=[MIN_BR] -javax.measure.unit.UCUM.GRAIN=[GR] -javax.measure.unit.UCUM.POUND=[LB_AV] -javax.measure.unit.UCUM.OUNCE=[OZ_AV] -javax.measure.unit.UCUM.DRAM=[DR_AV] -javax.measure.unit.UCUM.SHORT_HUNDREDWEIGHT=[SCWT_AV] -javax.measure.unit.UCUM.LONG_HUNDREDWEIGHT=[LCWT_AV] -javax.measure.unit.UCUM.SHORT_TON=[STON_AV] -javax.measure.unit.UCUM.LONG_TON=[LTON_AV] -javax.measure.unit.UCUM.STONE=[STONE_AV] -javax.measure.unit.UCUM.POUND_FORCE=[LBF_AV] -javax.measure.unit.UCUM.PENNYWEIGHT_TROY=[PWT_TR] -javax.measure.unit.UCUM.OUNCE_TROY=[OZ_TR] -javax.measure.unit.UCUM.POUND_TROY=[LB_TR] -javax.measure.unit.UCUM.SCRUPLE_APOTHECARY=[SC_AP] -javax.measure.unit.UCUM.DRAM_APOTHECARY=[DR_AP] -javax.measure.unit.UCUM.OUNCE_APOTHECARY=[OZ_AP] -javax.measure.unit.UCUM.POUND_APOTHECARY=[LB_AP] -javax.measure.unit.UCUM.LINE=[LNE] -javax.measure.unit.UCUM.POINT=[PNT] -javax.measure.unit.UCUM.PICA=[PCA] -javax.measure.unit.UCUM.POINT_PRINTER=[PNT_PR] -javax.measure.unit.UCUM.PICA_PRINTER=[PCA_PR] -javax.measure.unit.UCUM.PIED=[PIED] -javax.measure.unit.UCUM.POUCE=[POUCE] -javax.measure.unit.UCUM.LINGE=[LIGNE] -javax.measure.unit.UCUM.DIDOT=[DIDOT] -javax.measure.unit.UCUM.CICERO=[CICERO] -javax.measure.unit.UCUM.FAHRENHEIT=[DEGF] -javax.measure.unit.UCUM.CALORIE_AT_15C=CAL_[15] -javax.measure.unit.UCUM.CALORIE_AT_20C=CAL_[20] -javax.measure.unit.UCUM.CALORIE_MEAN=CAL_M -javax.measure.unit.UCUM.CALORIE_INTERNATIONAL_TABLE=CAL_IT -javax.measure.unit.UCUM.CALORIE_THERMOCHEMICAL=CAL_TH -javax.measure.unit.UCUM.CALORIE=CAL -javax.measure.unit.UCUM.CALORIE_FOOD=[CAL] -javax.measure.unit.UCUM.BTU_AT_39F=[BTU_39] -javax.measure.unit.UCUM.BTU_AT_59F=[BTU_59] -javax.measure.unit.UCUM.BTU_AT_60F=[BTU_60] -javax.measure.unit.UCUM.BTU_MEAN=[BTU_M] -javax.measure.unit.UCUM.BTU_INTERNATIONAL_TABLE=[BTU_IT] -javax.measure.unit.UCUM.BTU_THERMOCHEMICAL=[BTU_TH] -javax.measure.unit.UCUM.BTU=[BTU] -javax.measure.unit.UCUM.HORSEPOWER=[HP] -javax.measure.unit.UCUM.STERE=STR -javax.measure.unit.UCUM.ANGSTROM=AO -javax.measure.unit.UCUM.BARN=BRN -javax.measure.unit.UCUM.ATMOSPHERE_TECHNICAL=ATT -javax.measure.unit.UCUM.MHO=MHO -javax.measure.unit.UCUM.POUND_PER_SQUARE_INCH=[PSI] -javax.measure.unit.UCUM.CIRCLE=CIRC -javax.measure.unit.UCUM.SPHERE=SPH -javax.measure.unit.UCUM.CARAT_METRIC=[CAR_M] -javax.measure.unit.UCUM.CARAT_GOLD=[CAR_AU] -javax.measure.unit.UCUM.BIT=BIT -javax.measure.unit.UCUM.BYTE=BY -javax.measure.unit.UCUM.BAUD=Bd -javax.measure.unit.UCUM.FRAMES_PER_SECOND=fps diff --git a/src/main/resources/javax/measure/unit/format/UCUMFormat_CS.properties b/src/main/resources/javax/measure/unit/format/UCUMFormat_CS.properties deleted file mode 100644 index b68e390..0000000 --- a/src/main/resources/javax/measure/unit/format/UCUMFormat_CS.properties +++ /dev/null @@ -1,636 +0,0 @@ -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 4, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 3, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 18, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 04, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -# Prefixes - -javax.measure.unit.format.Prefix.YOTTA=Y -javax.measure.unit.format.Prefix.ZETTA=Z -javax.measure.unit.format.Prefix.EXA=E -javax.measure.unit.format.Prefix.PETA=P -javax.measure.unit.format.Prefix.TERA=T -javax.measure.unit.format.Prefix.GIGA=G -javax.measure.unit.format.Prefix.MEGA=M -javax.measure.unit.format.Prefix.KILO=k -javax.measure.unit.format.Prefix.HECTO=h -javax.measure.unit.format.Prefix.DEKA=da -javax.measure.unit.format.Prefix.DECI=d -javax.measure.unit.format.Prefix.CENTI=c -javax.measure.unit.format.Prefix.MILLI=m -javax.measure.unit.format.Prefix.MICRO=u -javax.measure.unit.format.Prefix.NANO=n -javax.measure.unit.format.Prefix.PICO=p -javax.measure.unit.format.Prefix.FEMTO=f -javax.measure.unit.format.Prefix.ATTO=a -javax.measure.unit.format.Prefix.ZEPTO=z -javax.measure.unit.format.Prefix.YOCTO=y - -# Units - -javax.measure.unit.UCUM.METER=m -javax.measure.unit.UCUM.SECOND=s -javax.measure.unit.UCUM.GRAM=g -javax.measure.unit.UCUM.RADIAN=rad -javax.measure.unit.UCUM.AMPERE_TURN=At -javax.measure.unit.UCUM.KELVIN=K -javax.measure.unit.UCUM.COULOMB=C -javax.measure.unit.UCUM.CANDELA=cd -javax.measure.unit.UCUM.TRIILLIONS=10^12 -javax.measure.unit.UCUM.BILLIONS=10^9 -javax.measure.unit.UCUM.MILLIONS=10^6 -javax.measure.unit.UCUM.THOUSANDS=10^3 -javax.measure.unit.UCUM.HUNDREDS=10^2 -javax.measure.unit.UCUM.PI=[pi] -javax.measure.unit.UCUM.PERCENT=% -javax.measure.unit.UCUM.PER_THOUSAND=[ppth] -javax.measure.unit.UCUM.PER_MILLION=[ppm] -javax.measure.unit.UCUM.PER_BILLION=[ppb] -javax.measure.unit.UCUM.PER_TRILLION=[pptr] -javax.measure.unit.UCUM.MOLE=mol -javax.measure.unit.UCUM.STERADIAN=sr -javax.measure.unit.UCUM.HERTZ=Hz -javax.measure.unit.UCUM.NEWTON=N -javax.measure.unit.UCUM.PASCAL=Pa -javax.measure.unit.UCUM.JOULE=J -javax.measure.unit.UCUM.WATT=W -javax.measure.unit.UCUM.AMPERE=A -javax.measure.unit.UCUM.VOLT=V -javax.measure.unit.UCUM.FARAD=F -javax.measure.unit.UCUM.OHM=Ohm -javax.measure.unit.UCUM.SIEMENS=S -javax.measure.unit.UCUM.WEBER=Wb -javax.measure.unit.UCUM.CELSIUS=Cel -javax.measure.unit.UCUM.TESLA=T -javax.measure.unit.UCUM.HENRY=H -javax.measure.unit.UCUM.LUMEN=lm -javax.measure.unit.UCUM.LUX=lx -javax.measure.unit.UCUM.BECQUEREL=Bq -javax.measure.unit.UCUM.GRAY=Gy -javax.measure.unit.UCUM.SIEVERT=Sv -javax.measure.unit.UCUM.DEGREE=deg -javax.measure.unit.UCUM.GRADE=gon -javax.measure.unit.UCUM.MINUTE_ANGLE=' -javax.measure.unit.UCUM.SECOND_ANGLE='' -javax.measure.unit.UCUM.LITER=l -javax.measure.unit.UCUM.LITER.1=L -javax.measure.unit.UCUM.ARE=ar -javax.measure.unit.UCUM.MINUTE=min -javax.measure.unit.UCUM.HOUR=h -javax.measure.unit.UCUM.DAY=d -javax.measure.unit.UCUM.YEAR_TROPICAL=a_t -javax.measure.unit.UCUM.YEAR_JULIAN=a_j -javax.measure.unit.UCUM.YEAR_GREGORIAN=a_g -javax.measure.unit.UCUM.YEAR=a -javax.measure.unit.UCUM.MONTH_SYNODAL=mo_s -javax.measure.unit.UCUM.MONTH_JULIAN=mo_j -javax.measure.unit.UCUM.MONTH_GREGORIAN=mo_g -javax.measure.unit.UCUM.MONTH=mo -javax.measure.unit.UCUM.TONNE=t -javax.measure.unit.UCUM.BAR=bar -javax.measure.unit.UCUM.ATOMIC_MASS_UNIT=u -javax.measure.unit.UCUM.ELECTRON_VOLT=eV -javax.measure.unit.UCUM.ASTRONOMIC_UNIT=AU -javax.measure.unit.UCUM.PARSEC=pc -javax.measure.unit.UCUM.C=[c] -javax.measure.unit.UCUM.PLANCK=[h] -javax.measure.unit.UCUM.BOLTZMAN=[k] -javax.measure.unit.UCUM.PERMITTIVITY_OF_VACUUM=[eps_0] -javax.measure.unit.UCUM.PERMEABILITY_OF_VACUUM=[mu_0] -javax.measure.unit.UCUM.ELEMENTARY_CHARGE=[e] -javax.measure.unit.UCUM.ELECTRON_MASS=[m_e] -javax.measure.unit.UCUM.PROTON_MASS=[m_p] -javax.measure.unit.UCUM.NEWTON_CONSTANT_OF_GRAVITY=[G] -javax.measure.unit.UCUM.ACCELLERATION_OF_FREEFALL=[g] -javax.measure.unit.UCUM.ATMOSPHERE=atm -javax.measure.unit.UCUM.LIGHT_YEAR=[ly] -javax.measure.unit.UCUM.GRAM_FORCE=gf -javax.measure.unit.UCUM.KAYSER=Ky -javax.measure.unit.UCUM.GAL=Gal -javax.measure.unit.UCUM.DYNE=dyn -javax.measure.unit.UCUM.ERG=erg -javax.measure.unit.UCUM.POISE=P -javax.measure.unit.UCUM.BIOT=Bi -javax.measure.unit.UCUM.STOKES=St -javax.measure.unit.UCUM.MAXWELL=Mx -javax.measure.unit.UCUM.GAUSS=G -javax.measure.unit.UCUM.OERSTED=Oe -javax.measure.unit.UCUM.GILBERT=Gb -javax.measure.unit.UCUM.STILB=sb -javax.measure.unit.UCUM.LAMBERT=Lmb -javax.measure.unit.UCUM.PHOT=ph -javax.measure.unit.UCUM.CURIE=Ci -javax.measure.unit.UCUM.ROENTGEN=R -javax.measure.unit.UCUM.RAD=RAD -javax.measure.unit.UCUM.REM=REM -javax.measure.unit.UCUM.INCH_INTERNATIONAL=[in_i] -javax.measure.unit.UCUM.FOOT_INTERNATIONAL=[ft_i] -javax.measure.unit.UCUM.YARD_INTERNATIONAL=[yd_i] -javax.measure.unit.UCUM.MILE_INTERNATIONAL=[mi_i] -javax.measure.unit.UCUM.FATHOM_INTERNATIONAL=[fth_i] -javax.measure.unit.UCUM.NAUTICAL_MILE_INTERNATIONAL=[nmi_i] -javax.measure.unit.UCUM.KNOT_INTERNATIONAL=[kn_i] -javax.measure.unit.UCUM.SQUARE_INCH_INTERNATIONAL=[sin_i] -javax.measure.unit.UCUM.SQUARE_FOOT_INTERNATIONAL=[sft_i] -javax.measure.unit.UCUM.SQUARE_YARD_INTERNATIONAL=[syd_i] -javax.measure.unit.UCUM.CUBIC_INCH_INTERNATIONAL=[cin_i] -javax.measure.unit.UCUM.CUBIC_FOOT_INTERNATIONAL=[cft_i] -javax.measure.unit.UCUM.CUBIC_YARD_INTERNATIONAL=[cyd_i] -javax.measure.unit.UCUM.BOARD_FOOT_INTERNATIONAL=[bf_i] -javax.measure.unit.UCUM.CORD_INTERNATIONAL=[cr_i] -javax.measure.unit.UCUM.MIL_INTERNATIONAL=[mil_i] -javax.measure.unit.UCUM.CIRCULAR_MIL_INTERNATIONAL=[cml_i] -javax.measure.unit.UCUM.HAND_INTERNATIONAL=[hd_i] -javax.measure.unit.UCUM.FOOT_US_SURVEY=[ft_us] -javax.measure.unit.UCUM.YARD_US_SURVEY=[yd_us] -javax.measure.unit.UCUM.INCH_US_SURVEY=[in_us] -javax.measure.unit.UCUM.ROD_US_SURVEY=[rd_us] -javax.measure.unit.UCUM.CHAIN_US_SURVEY=[ch_us] -javax.measure.unit.UCUM.LINK_US_SURVEY=[lk_us] -javax.measure.unit.UCUM.RAMDEN_CHAIN_US_SURVEY=[rch_us] -javax.measure.unit.UCUM.RAMDEN_LINK_US_SURVEY=[rlk_us] -javax.measure.unit.UCUM.FATHOM_US_SURVEY=[fth_us] -javax.measure.unit.UCUM.FURLONG_US_SURVEY=[fur_us] -javax.measure.unit.UCUM.MILE_US_SURVEY=[mi_us] -javax.measure.unit.UCUM.ACRE_US_SURVEY=[acr_us] -javax.measure.unit.UCUM.SQUARE_ROD_US_SURVEY=[srd_us] -javax.measure.unit.UCUM.SQUARE_MILE_US_SURVEY=[smi_us] -javax.measure.unit.UCUM.SECTION_US_SURVEY=[sct] -javax.measure.unit.UCUM.TOWNSHP_US_SURVEY=[twp] -javax.measure.unit.UCUM.MIL_US_SURVEY=[mil_us] -javax.measure.unit.UCUM.INCH_BRITISH=[in_br] -javax.measure.unit.UCUM.FOOT_BRITISH=[ft_br] -javax.measure.unit.UCUM.ROD_BRITISH=[rd_br] -javax.measure.unit.UCUM.CHAIN_BRITISH=[ch_br] -javax.measure.unit.UCUM.LINK_BRITISH=[lk_br] -javax.measure.unit.UCUM.FATHOM_BRITISH=[fth_br] -javax.measure.unit.UCUM.PACE_BRITISH=[pc_br] -javax.measure.unit.UCUM.YARD_BRITISH=[yd_br] -javax.measure.unit.UCUM.MILE_BRITISH=[mi_br] -javax.measure.unit.UCUM.NAUTICAL_MILE_BRITISH=[nmi_br] -javax.measure.unit.UCUM.KNOT_BRITISH=[kn_br] -javax.measure.unit.UCUM.ACRE_BRITISH=[acr_br] -javax.measure.unit.UCUM.GALLON_US=[gal_us] -javax.measure.unit.UCUM.BARREL_US=[bbl_us] -javax.measure.unit.UCUM.QUART_US=[qt_us] -javax.measure.unit.UCUM.PINT_US=[pt_us] -javax.measure.unit.UCUM.GILL_US=[gil_us] -javax.measure.unit.UCUM.FLUID_OUNCE_US=[foz_us] -javax.measure.unit.UCUM.FLUID_DRAM_US=[fdr_us] -javax.measure.unit.UCUM.MINIM_US=[min_us] -javax.measure.unit.UCUM.CORD_US=[crd_us] -javax.measure.unit.UCUM.BUSHEL_US=[bu_us] -javax.measure.unit.UCUM.GALLON_WINCHESTER=[gal_wi] -javax.measure.unit.UCUM.PECK_US=[pk_us] -javax.measure.unit.UCUM.DRY_QUART_US=[dqt_us] -javax.measure.unit.UCUM.DRY_PINT_US=[dpt_us] -javax.measure.unit.UCUM.TABLESPOON_US=[tbs_us] -javax.measure.unit.UCUM.TEASPOON_US=[tsp_us] -javax.measure.unit.UCUM.CUP_US=[cup_us] -javax.measure.unit.UCUM.GALLON_BRITISH=[gal_br] -javax.measure.unit.UCUM.PECK_BRITISH=[pk_br] -javax.measure.unit.UCUM.BUSHEL_BRITISH=[bu_br] -javax.measure.unit.UCUM.QUART_BRITISH=[qt_br] -javax.measure.unit.UCUM.PINT_BRITISH=[pt_br] -javax.measure.unit.UCUM.GILL_BRITISH=[gil_br] -javax.measure.unit.UCUM.FLUID_OUNCE_BRITISH=[foz_br] -javax.measure.unit.UCUM.FLUID_DRAM_BRITISH=[fdr_br] -javax.measure.unit.UCUM.MINIM_BRITISH=[min_br] -javax.measure.unit.UCUM.GRAIN=[gr] -javax.measure.unit.UCUM.POUND=[lb_av] -javax.measure.unit.UCUM.OUNCE=[oz_av] -javax.measure.unit.UCUM.DRAM=[dr_av] -javax.measure.unit.UCUM.SHORT_HUNDREDWEIGHT=[scwt_av] -javax.measure.unit.UCUM.LONG_HUNDREDWEIGHT=[lcwt_av] -javax.measure.unit.UCUM.SHORT_TON=[ston_av] -javax.measure.unit.UCUM.LONG_TON=[lton_av] -javax.measure.unit.UCUM.STONE=[stone_av] -javax.measure.unit.UCUM.POUND_FORCE=[lbf_av] -javax.measure.unit.UCUM.PENNYWEIGHT_TROY=[pwt_tr] -javax.measure.unit.UCUM.OUNCE_TROY=[oz_tr] -javax.measure.unit.UCUM.POUND_TROY=[lb_tr] -javax.measure.unit.UCUM.SCRUPLE_APOTHECARY=[sc_ap] -javax.measure.unit.UCUM.DRAM_APOTHECARY=[dr_ap] -javax.measure.unit.UCUM.OUNCE_APOTHECARY=[oz_ap] -javax.measure.unit.UCUM.POUND_APOTHECARY=[lb_ap] -javax.measure.unit.UCUM.LINE=[lne] -javax.measure.unit.UCUM.POINT=[pnt] -javax.measure.unit.UCUM.PICA=[pca] -javax.measure.unit.UCUM.POINT_PRINTER=[pnt_pr] -javax.measure.unit.UCUM.PICA_PRINTER=[pca_pr] -javax.measure.unit.UCUM.PIED=[pied] -javax.measure.unit.UCUM.POUCE=[pouce] -javax.measure.unit.UCUM.LINGE=[ligne] -javax.measure.unit.UCUM.DIDOT=[didot] -javax.measure.unit.UCUM.CICERO=[cicero] -javax.measure.unit.UCUM.FAHRENHEIT=[degF] -javax.measure.unit.UCUM.CALORIE_AT_15C=cal_[15] -javax.measure.unit.UCUM.CALORIE_AT_20C=cal_[20] -javax.measure.unit.UCUM.CALORIE_MEAN=cal_m -javax.measure.unit.UCUM.CALORIE_INTERNATIONAL_TABLE=cal_IT -javax.measure.unit.UCUM.CALORIE_THERMOCHEMICAL=cal_th -javax.measure.unit.UCUM.CALORIE=cal -javax.measure.unit.UCUM.CALORIE_FOOD=[Cal] -javax.measure.unit.UCUM.BTU_AT_39F=[Btu_39] -javax.measure.unit.UCUM.BTU_AT_59F=[Btu_59] -javax.measure.unit.UCUM.BTU_AT_60F=[Btu_60] -javax.measure.unit.UCUM.BTU_MEAN=[Btu_m] -javax.measure.unit.UCUM.BTU_INTERNATIONAL_TABLE=[Btu_IT] -javax.measure.unit.UCUM.BTU_THERMOCHEMICAL=[Btu_th] -javax.measure.unit.UCUM.BTU=[Btu] -javax.measure.unit.UCUM.HORSEPOWER=[HP] -javax.measure.unit.UCUM.STERE=st -javax.measure.unit.UCUM.ANGSTROM=Ao -javax.measure.unit.UCUM.BARN=b -javax.measure.unit.UCUM.ATMOSPHERE_TECHNICAL=att -javax.measure.unit.UCUM.MHO=mho -javax.measure.unit.UCUM.POUND_PER_SQUARE_INCH=[psi] -javax.measure.unit.UCUM.CIRCLE=circ -javax.measure.unit.UCUM.SPHERE=sph -javax.measure.unit.UCUM.CARAT_METRIC=[car_m] -javax.measure.unit.UCUM.CARAT_GOLD=[car_Au] -javax.measure.unit.UCUM.BIT=bit -javax.measure.unit.UCUM.BYTE=By -javax.measure.unit.UCUM.BAUD=Bd -javax.measure.unit.UCUM.FRAMES_PER_SECOND=fps - diff --git a/src/main/resources/javax/measure/unit/format/UCUMFormat_Print.properties b/src/main/resources/javax/measure/unit/format/UCUMFormat_Print.properties deleted file mode 100644 index d08304c..0000000 --- a/src/main/resources/javax/measure/unit/format/UCUMFormat_Print.properties +++ /dev/null @@ -1,638 +0,0 @@ -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 4, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# Version: 0.9.4 -# Status: Pre-FCS Public Release -# Release: December 3, 2009 -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 18, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# -# JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. -# -# -# -# Specification: JSR 275 - Units Specification ("Specification") -# -# -# Version: 0.9.2 -# -# -# Status: Pre-FCS Public Release -# -# -# Release: November 04, 2009 -# -# -# Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil -# -# All rights reserved. -# -# -# NOTICE -# -# The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its -# -# licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. -# -# -# Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: -# -# -# 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. -# -# 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: -# -# (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; -# -# (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and -# -# (iii) includes the following notice: -# -# "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: -# -# "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." -# -# The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. -# Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. -# -# "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof -# -# TRADEMARKS -# -# No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. -# -# -# DISCLAIMER OF WARRANTIES -# -# THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. -# -# -# THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. -# -# -# LIMITATION OF LIABILITY -# -# TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -# -# -# You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. -# -# -# RESTRICTED RIGHTS LEGEND -# -# If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in -# -# accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). -# -# -# REPORT -# -# You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. -# -# -# GENERAL TERMS -# -# Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. -# -# -# The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. -# -# -# This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. -# -# -# -# Rev. January 2006 -# -# Non-Sun/Spec/Public/EarlyAccess -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# NOTE: as a Java properties file, this file must use the -# ISO 8859-1 encoding, so all non-ASCII Unicode characters -# must be escaped using the \uXXXX syntax. -# See http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding - -# Prefixes - -javax.measure.unit.format.Prefix.YOTTA=Y -javax.measure.unit.format.Prefix.ZETTA=Z -javax.measure.unit.format.Prefix.EXA=E -javax.measure.unit.format.Prefix.PETA=P -javax.measure.unit.format.Prefix.TERA=T -javax.measure.unit.format.Prefix.GIGA=G -javax.measure.unit.format.Prefix.MEGA=M -javax.measure.unit.format.Prefix.KILO=k -javax.measure.unit.format.Prefix.HECTO=h -javax.measure.unit.format.Prefix.DEKA=da -javax.measure.unit.format.Prefix.DECI=d -javax.measure.unit.format.Prefix.CENTI=c -javax.measure.unit.format.Prefix.MILLI=m -javax.measure.unit.format.Prefix.MICRO=\u03BC -javax.measure.unit.format.Prefix.NANO=n -javax.measure.unit.format.Prefix.PICO=p -javax.measure.unit.format.Prefix.FEMTO=f -javax.measure.unit.format.Prefix.ATTO=a -javax.measure.unit.format.Prefix.ZEPTO=z -javax.measure.unit.format.Prefix.YOCTO=y - -# Units - -javax.measure.unit.UCUM.METER=m -javax.measure.unit.UCUM.AMPERE_TURN=At -javax.measure.unit.UCUM.SECOND=s -javax.measure.unit.UCUM.GRAM=g -javax.measure.unit.UCUM.RADIAN=rad -javax.measure.unit.UCUM.KELVIN=K -javax.measure.unit.UCUM.COULOMB=C -javax.measure.unit.UCUM.CANDELA=ca -javax.measure.unit.UCUM.TRIILLIONS=10\u00B9\u00B2 -javax.measure.unit.UCUM.BILLIONS=10\u2079 -javax.measure.unit.UCUM.MILLIONS=10\u2076 -javax.measure.unit.UCUM.THOUSANDS=10\u00B3 -javax.measure.unit.UCUM.HUNDREDS=10\u00B2 -javax.measure.unit.UCUM.PI=\u03C0 -javax.measure.unit.UCUM.PERCENT=% -javax.measure.unit.UCUM.PER_THOUSAND=ppth -javax.measure.unit.UCUM.PER_MILLION=ppm -javax.measure.unit.UCUM.PER_BILLION=ppb -javax.measure.unit.UCUM.PER_TRILLION=pptr -javax.measure.unit.UCUM.MOLE=mol -javax.measure.unit.UCUM.STERADIAN=sr -javax.measure.unit.UCUM.HERTZ=Hz -javax.measure.unit.UCUM.NEWTON=N -javax.measure.unit.UCUM.PASCAL=Pa -javax.measure.unit.UCUM.JOULE=J -javax.measure.unit.UCUM.WATT=W -javax.measure.unit.UCUM.AMPERE=A -javax.measure.unit.UCUM.VOLT=V -javax.measure.unit.UCUM.FARAD=F -javax.measure.unit.UCUM.OHM=\u03A9 -javax.measure.unit.UCUM.SIEMENS=S -javax.measure.unit.UCUM.WEBER=Wb -javax.measure.unit.UCUM.CELSIUS=\u00B0C -javax.measure.unit.UCUM.TESLA=T -javax.measure.unit.UCUM.HENRY=H -javax.measure.unit.UCUM.LUMEN=lm -javax.measure.unit.UCUM.LUX=lx -javax.measure.unit.UCUM.BECQUEREL=Bq -javax.measure.unit.UCUM.GRAY=Gy -javax.measure.unit.UCUM.SIEVERT=Sv -javax.measure.unit.UCUM.DEGREE=\u00B0 -javax.measure.unit.UCUM.GRADE=\u25A1g -javax.measure.unit.UCUM.MINUTE_ANGLE=' -javax.measure.unit.UCUM.SECOND_ANGLE=\" -javax.measure.unit.UCUM.LITER=l -javax.measure.unit.UCUM.ARE=a -javax.measure.unit.UCUM.MINUTE=min -javax.measure.unit.UCUM.HOUR=h -javax.measure.unit.UCUM.DAY=d -javax.measure.unit.UCUM.YEAR_TROPICAL=a_t -javax.measure.unit.UCUM.YEAR_JULIAN=a_j -javax.measure.unit.UCUM.YEAR_GREGORIAN=a_g -javax.measure.unit.UCUM.YEAR=a -javax.measure.unit.UCUM.MONTH_SYNODAL=mo_s -javax.measure.unit.UCUM.MONTH_JULIAN=mo_j -javax.measure.unit.UCUM.MONTH_GREGORIAN=mo_g -javax.measure.unit.UCUM.MONTH=mo -javax.measure.unit.UCUM.TONNE=t -javax.measure.unit.UCUM.BAR=bar -javax.measure.unit.UCUM.ATOMIC_MASS_UNIT=u -javax.measure.unit.UCUM.ELECTRON_VOLT=eV -javax.measure.unit.UCUM.ASTRONOMIC_UNIT=AU -javax.measure.unit.UCUM.PARSEC=PC -javax.measure.unit.UCUM.C=c -javax.measure.unit.UCUM.PLANCK=h -javax.measure.unit.UCUM.BOLTZMAN=k -javax.measure.unit.UCUM.PERMITTIVITY_OF_VACUUM=\u03B5\u2080 -javax.measure.unit.UCUM.PERMEABILITY_OF_VACUUM=\u03BC\u2080 -javax.measure.unit.UCUM.ELEMENTARY_CHARGE=e -javax.measure.unit.UCUM.ELECTRON_MASS=m_e -javax.measure.unit.UCUM.PROTON_MASS=m_p -javax.measure.unit.UCUM.NEWTON_CONSTANT_OF_GRAVITY=G -javax.measure.unit.UCUM.ACCELLERATION_OF_FREEFALL=g_n -javax.measure.unit.UCUM.ATMOSPHERE=atm -javax.measure.unit.UCUM.LIGHT_YEAR=l.y. -javax.measure.unit.UCUM.GRAM_FORCE=gf -javax.measure.unit.UCUM.KAYSER=K -javax.measure.unit.UCUM.GAL=Gal -javax.measure.unit.UCUM.DYNE=dyn -javax.measure.unit.UCUM.ERG=erg -javax.measure.unit.UCUM.POISE=P -javax.measure.unit.UCUM.BIOT=Bi -javax.measure.unit.UCUM.STOKES=St -javax.measure.unit.UCUM.MAXWELL=Mx -javax.measure.unit.UCUM.GAUSS=Gs -javax.measure.unit.UCUM.OERSTED=Oe -javax.measure.unit.UCUM.GILBERT=Gb -javax.measure.unit.UCUM.STILB=sb -javax.measure.unit.UCUM.LAMBERT=L -javax.measure.unit.UCUM.PHOT=ph -javax.measure.unit.UCUM.CURIE=Ci -javax.measure.unit.UCUM.ROENTGEN=R -javax.measure.unit.UCUM.RAD=RAD -javax.measure.unit.UCUM.REM=REM -javax.measure.unit.UCUM.INCH_INTERNATIONAL=in_i -javax.measure.unit.UCUM.FOOT_INTERNATIONAL=ft_i -javax.measure.unit.UCUM.YARD_INTERNATIONAL=yd_i -javax.measure.unit.UCUM.MILE_INTERNATIONAL=mi_i -javax.measure.unit.UCUM.FATHOM_INTERNATIONAL=fth_i -javax.measure.unit.UCUM.NAUTICAL_MILE_INTERNATIONAL=nmi_i -javax.measure.unit.UCUM.KNOT_INTERNATIONAL=kn_i -javax.measure.unit.UCUM.SQUARE_INCH_INTERNATIONAL=sin_i -javax.measure.unit.UCUM.SQUARE_FOOT_INTERNATIONAL=sft_i -javax.measure.unit.UCUM.SQUARE_YARD_INTERNATIONAL=syd_i -javax.measure.unit.UCUM.CUBIC_INCH_INTERNATIONAL=cin_i -javax.measure.unit.UCUM.CUBIC_FOOT_INTERNATIONAL=cft_i -javax.measure.unit.UCUM.CUBIC_YARD_INTERNATIONAL=cyd_i -javax.measure.unit.UCUM.BOARD_FOOT_INTERNATIONAL=bf_i -javax.measure.unit.UCUM.CORD_INTERNATIONAL=cr_i -javax.measure.unit.UCUM.MIL_INTERNATIONAL=mil_i -javax.measure.unit.UCUM.CIRCULAR_MIL_INTERNATIONAL=cml_i -javax.measure.unit.UCUM.HAND_INTERNATIONAL=hd_i -javax.measure.unit.UCUM.FOOT_US_SURVEY=ft_us -javax.measure.unit.UCUM.YARD_US_SURVEY=yd_us -javax.measure.unit.UCUM.INCH_US_SURVEY=in_us -javax.measure.unit.UCUM.ROD_US_SURVEY=rd_us -javax.measure.unit.UCUM.CHAIN_US_SURVEY=ch_us -javax.measure.unit.UCUM.LINK_US_SURVEY=lk_us -javax.measure.unit.UCUM.RAMDEN_CHAIN_US_SURVEY=rch_us -javax.measure.unit.UCUM.RAMDEN_LINK_US_SURVEY=rlk_us -javax.measure.unit.UCUM.FATHOM_US_SURVEY=fth_us -javax.measure.unit.UCUM.FURLONG_US_SURVEY=fur_us -javax.measure.unit.UCUM.MILE_US_SURVEY=mi_us -javax.measure.unit.UCUM.ACRE_US_SURVEY=acr_us -javax.measure.unit.UCUM.SQUARE_ROD_US_SURVEY=src_us -javax.measure.unit.UCUM.SQUARE_MILE_US_SURVEY=smi_us -javax.measure.unit.UCUM.SECTION_US_SURVEY=sct -javax.measure.unit.UCUM.TOWNSHP_US_SURVEY=twp -javax.measure.unit.UCUM.MIL_US_SURVEY=mil_us -javax.measure.unit.UCUM.INCH_BRITISH=in_br -javax.measure.unit.UCUM.FOOT_BRITISH=ft_br -javax.measure.unit.UCUM.ROD_BRITISH=rd_br -javax.measure.unit.UCUM.CHAIN_BRITISH=ch_br -javax.measure.unit.UCUM.LINK_BRITISH=lk_br -javax.measure.unit.UCUM.FATHOM_BRITISH=fth_br -javax.measure.unit.UCUM.PACE_BRITISH=pc_br -javax.measure.unit.UCUM.YARD_BRITISH=yd_br -javax.measure.unit.UCUM.MILE_BRITISH=mi_br -javax.measure.unit.UCUM.NAUTICAL_MILE_BRITISH=nmi_br -javax.measure.unit.UCUM.KNOT_BRITISH=kn_br -javax.measure.unit.UCUM.ACRE_BRITISH=acr_br -javax.measure.unit.UCUM.GALLON_US=gal_us -javax.measure.unit.UCUM.BARREL_US=bbl_us -javax.measure.unit.UCUM.QUART_US=qt_us -javax.measure.unit.UCUM.PINT_US=pt_us -javax.measure.unit.UCUM.GILL_US=gil_us -javax.measure.unit.UCUM.FLUID_OUNCE_US=foz_us -javax.measure.unit.UCUM.FLUID_DRAM_US=fdr_us -javax.measure.unit.UCUM.MINIM_US=min_us -javax.measure.unit.UCUM.CORD_US=crd_us -javax.measure.unit.UCUM.BUSHEL_US=bu_us -javax.measure.unit.UCUM.GALLON_WINCHESTER=gal_wi -javax.measure.unit.UCUM.PECK_US=pk_us -javax.measure.unit.UCUM.DRY_QUART_US=dqt_us -javax.measure.unit.UCUM.DRY_PINT_US=dpt_us -javax.measure.unit.UCUM.TABLESPOON_US=tbs_us -javax.measure.unit.UCUM.TEASPOON_US=tsp_us -javax.measure.unit.UCUM.CUP_US=cup_us -javax.measure.unit.UCUM.GALLON_BRITISH=gal_br -javax.measure.unit.UCUM.PECK_BRITISH=pk_br -javax.measure.unit.UCUM.BUSHEL_BRITISH=bu_br -javax.measure.unit.UCUM.QUART_BRITISH=qt_br -javax.measure.unit.UCUM.PINT_BRITISH=pt_br -javax.measure.unit.UCUM.GILL_BRITISH=gil_br -javax.measure.unit.UCUM.FLUID_OUNCE_BRITISH=foz_br -javax.measure.unit.UCUM.FLUID_DRAM_BRITISH=fdr_br -javax.measure.unit.UCUM.MINIM_BRITISH=min_br -javax.measure.unit.UCUM.GRAIN=gr -javax.measure.unit.UCUM.POUND=lb_av -javax.measure.unit.UCUM.OUNCE=oz_av -javax.measure.unit.UCUM.DRAM=dr_av -javax.measure.unit.UCUM.SHORT_HUNDREDWEIGHT=scwt_av -javax.measure.unit.UCUM.LONG_HUNDREDWEIGHT=lcwt_av -javax.measure.unit.UCUM.SHORT_TON=ston_av -javax.measure.unit.UCUM.LONG_TON=lton_av -javax.measure.unit.UCUM.STONE=stone_av -javax.measure.unit.UCUM.POUND_FORCE=lbf -javax.measure.unit.UCUM.PENNYWEIGHT_TROY=pwt_tr -javax.measure.unit.UCUM.OUNCE_TROY=oz_tr -javax.measure.unit.UCUM.POUND_TROY=lb_tr -javax.measure.unit.UCUM.SCRUPLE_APOTHECARY=sc_ap -javax.measure.unit.UCUM.DRAM_APOTHECARY=dr_ap -javax.measure.unit.UCUM.OUNCE_APOTHECARY=oz_ap -javax.measure.unit.UCUM.POUND_APOTHECARY=lb_ap -javax.measure.unit.UCUM.LINE=lne -javax.measure.unit.UCUM.POINT=pnt -javax.measure.unit.UCUM.PICA=pca -javax.measure.unit.UCUM.POINT_PRINTER=pnt_pr -javax.measure.unit.UCUM.PICA_PRINTER=pca_pr -javax.measure.unit.UCUM.PIED=pied -javax.measure.unit.UCUM.POUCE=pouce -javax.measure.unit.UCUM.LINGE=linge -javax.measure.unit.UCUM.DIDOT=didot -javax.measure.unit.UCUM.CICERO=cicero -javax.measure.unit.UCUM.FAHRENHEIT=\u00B0F -javax.measure.unit.UCUM.CALORIE_AT_15C=cal15\u00B0C -javax.measure.unit.UCUM.CALORIE_AT_20C=cal20\u00B0C -javax.measure.unit.UCUM.CALORIE_MEAN=cal_m -javax.measure.unit.UCUM.CALORIE_INTERNATIONAL_TABLE=cal_IT -javax.measure.unit.UCUM.CALORIE_THERMOCHEMICAL=cal_th -javax.measure.unit.UCUM.CALORIE=cal -javax.measure.unit.UCUM.CALORIE_FOOD=Cal -javax.measure.unit.UCUM.BTU_AT_39F=Btu39\u00B0F -javax.measure.unit.UCUM.BTU_AT_59F=Btu59\u00B0F -javax.measure.unit.UCUM.BTU_AT_60F=Btu60\u00B0F -javax.measure.unit.UCUM.BTU_MEAN=Btu_m -javax.measure.unit.UCUM.BTU_INTERNATIONAL_TABLE=Btu_IT -javax.measure.unit.UCUM.BTU_THERMOCHEMICAL=Btu_th -javax.measure.unit.UCUM.BTU=btu -javax.measure.unit.UCUM.HORSEPOWER=HP -javax.measure.unit.UCUM.STERE=st -javax.measure.unit.UCUM.ANGSTROM=\u00C5 -javax.measure.unit.UCUM.BARN=b -javax.measure.unit.UCUM.ATMOSPHERE_TECHNICAL=at -javax.measure.unit.UCUM.MHO=mho -javax.measure.unit.UCUM.POUND_PER_SQUARE_INCH=psi -javax.measure.unit.UCUM.CIRCLE=circ -javax.measure.unit.UCUM.SPHERE=sph -javax.measure.unit.UCUM.CARAT_METRIC=ct_m -javax.measure.unit.UCUM.CARAT_GOLD=ct_Au -javax.measure.unit.UCUM.BIT=bit -javax.measure.unit.UCUM.BYTE=B -javax.measure.unit.UCUM.BAUD=Bd -javax.measure.unit.UCUM.FRAMES_PER_SECOND=fps diff --git a/src/test/java/javax/measure/MeasureConversionTest.java b/src/test/java/javax/measure/MeasureConversionTest.java index 0fe6b8b..087f8ad 100644 --- a/src/test/java/javax/measure/MeasureConversionTest.java +++ b/src/test/java/javax/measure/MeasureConversionTest.java @@ -80,7 +80,7 @@ */ package javax.measure; -import static javax.measure.unit.format.TestUtil.*; +import static javax.measure.util.TestUtil.*; import java.math.BigDecimal; import java.math.MathContext; @@ -91,7 +91,7 @@ import junit.framework.TestCase; /** - * @version $Revision: 76 $, $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version $Revision: 91 $, $Date: 2010-01-31 23:15:50 +0100 (So, 31 Jän 2010) $ * @author $Author: keilw $ */ public class MeasureConversionTest extends TestCase { diff --git a/src/test/java/javax/measure/MeasureTest.java b/src/test/java/javax/measure/MeasureTest.java index cc21ae4..158b112 100644 --- a/src/test/java/javax/measure/MeasureTest.java +++ b/src/test/java/javax/measure/MeasureTest.java @@ -83,8 +83,10 @@ import static javax.measure.unit.SI.*; import static javax.measure.unit.SI.MetricPrefix.*; import static javax.measure.unit.NonSI.*; -import static javax.measure.unit.format.TestUtil.print; +import static javax.measure.util.TestUtil.print; +import java.lang.reflect.Field; +import java.lang.reflect.ParameterizedType; import java.math.BigDecimal; import java.math.MathContext; @@ -92,13 +94,14 @@ import javax.measure.quantity.Length; import javax.measure.unit.SI; import javax.measure.unit.Unit; + import junit.framework.TestCase; /** * Unit tests for Measure class (incomplete). * @author Werner Keil - * @version $Revision: 76 $, $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version $Revision: 91 $, $Date: 2010-01-31 23:15:50 +0100 (So, 31 Jän 2010) $ */ public class MeasureTest extends TestCase { @@ -229,10 +232,11 @@ public void testCompareTo_Measurable() { /** * Test of equals method, of class Measure. */ - public void testEquals_Object() { - print("unit"); - assertEquals(Measure.valueOf("123 km"), Measure.valueOf("123 m.1000")); - } +// TODO this currently relies on UCUM parsing +// public void testEquals_Object() { +// print("unit"); +// assertEquals(Measure.valueOf("123 km"), Measure.valueOf("123 m·1000")); +// } /** * Test of hashCode method, of class Measure. @@ -322,12 +326,17 @@ public void testAsType() { /** * Test of valueOf method, of class Measure. */ - public void testValueOf_int_Unit_2args() { + public void testValueOf_int_Unit_2args() throws Exception { int intValue = 123; Unit unit = km; Measure expResult = intMeasure; Measure result = Measure.valueOf(intValue, unit); assertEquals(expResult, result); + + Field field = MeasureTest.class.getDeclaredField("intMeasure"); + ParameterizedType type = (ParameterizedType) field.getGenericType(); + assertEquals(Measure.class, type.getRawType()); + assertEquals(Length.class, type.getActualTypeArguments() [0]); } /** diff --git a/src/test/java/javax/measure/unit/SITest.java b/src/test/java/javax/measure/unit/SITest.java index d7ad2d5..9b8a72e 100644 --- a/src/test/java/javax/measure/unit/SITest.java +++ b/src/test/java/javax/measure/unit/SITest.java @@ -80,14 +80,14 @@ */ package javax.measure.unit; -import static javax.measure.unit.format.TestUtil.print; +import static javax.measure.util.TestUtil.print; import junit.framework.TestCase; /** * Unit test for class javax.measure.unit.SI * @author Werner Keil - * @version 1.0.2 ($Revision: 76 $), $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version 1.0.2 ($Revision: 92 $), $Date: 2010-01-31 23:16:07 +0100 (So, 31 Jän 2010) $ */ public class SITest extends TestCase { @@ -113,7 +113,8 @@ public static void main(String[] args) { */ public void testGetInstance() { - print("getInstance" + NonSI.GALLON_UK.divide(8) + " ?"); + print("getInstance: " + NonSI.GALLON_UK.divide(8) + " (" + + NonSI.GALLON_UK.divide(8).getDimension().toString() + ")"); SI result = SI.getInstance(); // Checks SI contains the 7 SI base units. @@ -124,8 +125,10 @@ public void testGetInstance() { assertTrue(result.getUnits().contains(Unit.valueOf("K"))); assertTrue(result.getUnits().contains(Unit.valueOf("cd"))); assertTrue(result.getUnits().contains(Unit.valueOf("A"))); + + print(Unit.valueOf("m").getDimension().toString()); } -} +} \ No newline at end of file diff --git a/src/test/java/javax/measure/unit/UnitFormatTest.java b/src/test/java/javax/measure/unit/UnitFormatTest.java index ad6b192..ee25a55 100644 --- a/src/test/java/javax/measure/unit/UnitFormatTest.java +++ b/src/test/java/javax/measure/unit/UnitFormatTest.java @@ -80,7 +80,9 @@ */ package javax.measure.unit; -import static javax.measure.unit.format.TestUtil.*; +import static javax.measure.unit.SI.*; +import static javax.measure.unit.NonSI.*; +import static javax.measure.util.TestUtil.*; import java.util.Locale; @@ -90,7 +92,7 @@ /** * @author Werner Keil - * @version $Revision: 76 $, $Date: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version $Revision: 92 $, $Date: 2010-01-31 23:16:07 +0100 (So, 31 Jän 2010) $ */ public class UnitFormatTest extends TestCase { private static final String COMPARISON_POINT = "pt"; @@ -104,8 +106,8 @@ protected void setUp() throws Exception { super.setUp(); //setName(UCUMFormatTest.class.getSimpleName()); - l1 = SI.CENTIMETRE; - l2 = NonSI.POINT; + l1 = CENTIMETRE; + l2 = POINT; print("Running " + getName()+ " [" + getClass().getSimpleName() + "]"); @@ -136,7 +138,7 @@ public void testGetInstanceLocale() { } public void testGetStandard() { - format = UnitFormat.getStandard(); + format = UnitFormat.getInstance(); String formattedText = format.format(l1); print(formattedText); //System.out.println(unit2); diff --git a/src/test/java/javax/measure/unit/UnitTest.java b/src/test/java/javax/measure/unit/UnitTest.java index de429bf..09bd0ae 100644 --- a/src/test/java/javax/measure/unit/UnitTest.java +++ b/src/test/java/javax/measure/unit/UnitTest.java @@ -80,7 +80,7 @@ */ package javax.measure.unit; -import javax.measure.converter.UnitConverter; +import javax.measure.unit.UnitConverter; import javax.measure.quantity.Dimensionless; import javax.measure.quantity.Quantity; import javax.measure.unit.Unit; @@ -89,7 +89,7 @@ /** * @author Werner Keil - * @version $LastChangedRevision: 76 $, $LastChangedDate: 2009-12-03 23:53:52 +0100 (Do, 03 Dez 2009) $ + * @version $LastChangedRevision: 92 $, $LastChangedDate: 2010-01-31 23:16:07 +0100 (So, 31 Jän 2010) $ */ public class UnitTest extends TestCase { Unit one; @@ -178,34 +178,34 @@ public void testTransform() { } /** - * Test method for {@link javax.measure.unit.Unit#plus(double)}. + * Test method for {@link javax.measure.unit.Unit#add(double)}. */ public void testPlus() { - Unit result = one.plus(10); + Unit result = one.add(10); assertNotSame(result, one); } /** - * Test method for {@link javax.measure.unit.Unit#times(long)}. + * Test method for {@link javax.measure.unit.Unit#multiply(long)}. */ public void testTimesLong() { - Unit result = one.times(2L); + Unit result = one.multiply(2L); assertNotSame(result, one); } /** - * Test method for {@link javax.measure.unit.Unit#times(double)}. + * Test method for {@link javax.measure.unit.Unit#multiply(double)}. */ public void testTimesDouble() { - Unit result = one.times(2.1); + Unit result = one.multiply(2.1); assertNotSame(result, one); } /** - * Test method for {@link javax.measure.unit.Unit#times(javax.measure.unit.Unit)}. + * Test method for {@link javax.measure.unit.Unit#multiply(javax.measure.unit.Unit)}. */ public void testTimesUnitOfQ() { - Unit result = one.times(one); + Unit result = one.multiply(one); assertEquals(result, one); } diff --git a/src/test/java/javax/measure/unit/format/TestUtil.java b/src/test/java/javax/measure/unit/format/TestUtil.java deleted file mode 100644 index ae2f643..0000000 --- a/src/test/java/javax/measure/unit/format/TestUtil.java +++ /dev/null @@ -1,101 +0,0 @@ -/** - * JEAN-MARIE DAUTELLE, WERNER KEIL ARE WILLING TO LICENSE THIS SPECIFICATION TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS CONTAINED IN THIS LICENSE AGREEMENT ("AGREEMENT"). PLEASE READ THE TERMS AND CONDITIONS OF THIS AGREEMENT CAREFULLY. BY DOWNLOADING THIS SPECIFICATION, YOU ACCEPT THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU ARE NOT WILLING TO BE BOUND BY THEM, SELECT THE "DECLINE" BUTTON AT THE BOTTOM OF THIS PAGE AND THE DOWNLOADING PROCESS WILL NOT CONTINUE. - * - * Specification: JSR 275 - Units Specification ("Specification") - * - * Version: 0.9.4 - * Status: Pre-FCS Public Release - * Release: December 4, 2009 - * - * Copyright 2005-2009 Jean-Marie Dautelle, Werner Keil - * All rights reserved. - * - * - * NOTICE - * - * The Specification is protected by copyright and the information described therein may be protected by one or more U.S. patents, foreign patents, or pending applications. Except as provided under the following license, no part of the Specification may be reproduced in any form by any means without the prior written authorization of Jean-Marie Dautelle, Werner Keil and its - * licensors, if any. Any use of the Specification and the information described therein will be governed by the terms and conditions of this Agreement. - * - * - * Subject to the terms and conditions of this license, including your compliance with Paragraphs 1, 2 and 3 below, Jean-Marie Dautelle and Werner Keil hereby grant you a fully-paid, non-exclusive, non-transferable, limited license (without the right to sublicense) under Jean-Marie Dautelle and Werner Keil's intellectual property rights to: - * - * 1. Review the Specification for the purposes of evaluation. This includes: (i) developing implementations of the Specification for your internal, non-commercial use; (ii) discussing the Specification with any third party; and (iii) excerpting brief portions of the Specification in oral or written communications which discuss the Specification provided that such excerpts do not in the aggregate constitute a significant portion of the Specification. - * - * 2. Distribute implementations of the Specification to third parties for their testing and evaluation use, provided that any such implementation: - * - * (i) does not modify, subset, superset or otherwise extend the Licensor Name Space, or include any public or protected packages, classes, Java interfaces, fields or methods within the Licensor Name Space other than those required/authorized by the Specification or Specifications being implemented; - * - * (ii) is clearly and prominently marked with the word "UNTESTED" or "EARLY ACCESS" or "INCOMPATIBLE" or "UNSTABLE" or "BETA" in any list of available builds and in proximity to every link initiating its download, where the list or link is under Licensee's control; and - * - * (iii) includes the following notice: - * "This is an implementation of an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * 3. Distribute applications written to the Specification to third parties for their testing and evaluation use, provided that any such application includes the following notice: - * "This is an application written to interoperate with an early-draft specification developed under the Java Community Process (JCP) and is made available for testing and evaluation purposes only. The code is not compatible with any specification of the JCP." - * - * The grant set forth above concerning your distribution of implementations of the Specification is contingent upon your agreement to terminate development and distribution of your implementation of early draft upon final completion of the Specification. If you fail to do so, the foregoing grant shall be considered null and void. - * - * Other than this limited license, you acquire no right, title or interest in or to the Specification or any other Jean-Marie Dautelle and Werner Keil intellectual property, and the Specification may only be used in accordance with the license terms set forth herein. This license will expire on the earlier of: (a) two (2) years from the date of Release listed above; (b) the date on which the final version of the Specification is publicly released; or (c) the date on which the Java Specification Request (JSR) to which the Specification corresponds is withdrawn. In addition, this license will terminate immediately without notice from Jean-Marie Dautelle, Werner Keil if you fail to comply with any provision of this license. Upon termination, you must cease use of or destroy the Specification. - * - * "Licensor Name Space" means the public class or interface declarations whose names begin with "java", "javax", "org.jscience" or their equivalents in any subsequent naming convention adopted through the Java Community Process, or any recognized successors or replacements thereof - * - * - * TRADEMARKS - * - * No right, title, or interest in or to any trademarks, service marks, or trade names of Jean-Marie Dautelle, Werner Keil or Jean-Marie Dautelle and Werner Keil's licensors is granted hereunder. Java and Java-related logos, marks and names are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. - * - * - * DISCLAIMER OF WARRANTIES - * - * THE SPECIFICATION IS PROVIDED "AS IS" AND IS EXPERIMENTAL AND MAY CONTAIN DEFECTS OR DEFICIENCIES WHICH CANNOT OR WILL NOT BE CORRECTED BY JEAN-MARIE DAUTELLE, WERNER KEIL. JEAN-MARIE DAUTELLE AND WERNER KEIL MAKE NO REPRESENTATIONS OR WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT THAT THE CONTENTS OF THE SPECIFICATION ARE SUITABLE FOR ANY PURPOSE OR THAT ANY PRACTICE OR IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADE SECRETS OR OTHER RIGHTS. This document does not represent any commitment to release or implement any portion of the Specification in any product. - * - * THE SPECIFICATION COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION THEREIN; THESE CHANGES WILL BE INCORPORATED INTO NEW VERSIONS OF THE SPECIFICATION, IF ANY. JEAN-MARIE DAUTELL AND WERNER KEIL MAY MAKE IMPROVEMENTS AND/OR CHANGES TO THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THE SPECIFICATION AT ANY TIME. Any use of such changes in the Specification will be governed by the then-current license for the applicable version of the Specification. - * - * - * LIMITATION OF LIABILITY - * - * TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL JEAN-MARIE DAUTELLE, WERNER KEIL OR THEIR LICENSORS BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION, LOST REVENUE, PROFITS OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO ANY FURNISHING, PRACTICING, MODIFYING OR ANY USE OF THE SPECIFICATION, EVEN IF JEAN-MARIE DAUTELLE, WERNER KEIL AND/OR ITS LICENSORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You will hold Jean-Marie Dautelle, Werner Keil (and its licensors) harmless from any claims based on your use of the Specification for any purposes other than the limited right of evaluation as described above, and from any claims that later versions or releases of any Specification furnished to you are incompatible with the Specification provided to you under this license. - * - * - * RESTRICTED RIGHTS LEGEND - * - * If this Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in the Software and accompanying documentation shall be only as set forth in this license; this is in - * accordance with 48 C.F.R. 227.7201 through 227.7202-4 (for Department of Defense (DoD) acquisitions) and with 48 C.F.R. 2.101 and 12.212 (for non-DoD acquisitions). - * - * - * REPORT - * - * You may wish to report any ambiguities, inconsistencies or inaccuracies you may find in connection with your evaluation of the Specification ("Feedback"). To the extent that you provide Jean-Marie Dautelle, Werner Keil with any Feedback, you hereby: (i) agree that such Feedback is provided on a non-proprietary and non-confidential basis, and (ii) grant Jean-Marie Dautelle, Werner Keil a perpetual, non-exclusive, worldwide, fully paid-up, irrevocable license, with the right to sublicense through multiple levels of sublicensees, to incorporate, disclose, and use without limitation the Feedback for any purpose related to the Specification and future versions, implementations, and test suites thereof. - * - * - * GENERAL TERMS - * - * Any action related to this Agreement will be governed by California law and controlling U.S. federal law. The U.N. Convention for the International Sale of Goods and the choice of law rules of any jurisdiction will not apply. - * - * The Specification is subject to U.S. export control laws and may be subject to export or import regulations in other countries. Licensee agrees to comply strictly with all such laws and regulations and acknowledges that it has the responsibility to obtain such licenses to export, re-export or import as may be required after delivery to Licensee. - * - * This Agreement is the parties' entire agreement relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, conditions, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification to this Agreement will be binding, unless in writing and signed by an authorized representative of each party. - */ -package javax.measure.unit.format; - -/** - * A static helper class, checking e.g. if some tests require optional console output - * TODO this should be done using a logging framework eventually - * - * @version $Revision$, $Date$ - * @author $Author: keilw $ - */ -public abstract class TestUtil { - private static final String TEST_CONSOLE_OUTPUT = "testConsoleOutput"; - - public static final boolean isTestOutput() { - return ("true".equals(System.getProperty(TEST_CONSOLE_OUTPUT))); - } - public static final void print(String message) { - if (isTestOutput()) { - System.out.println(message); - } - } -}