Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a Measurement/Quantity List structure #3

Open
keilw opened this issue Sep 5, 2014 · 0 comments
Open

Provide a Measurement/Quantity List structure #3

keilw opened this issue Sep 5, 2014 · 0 comments

Comments

@keilw
Copy link
Member

keilw commented Sep 5, 2014

While it probably won't be more than an optional type in a module like "util" (similar to others like Range) how do you consider a "List Pattern" similar to Unicode CLDR:
http://cldr.unicode.org/index/downloads/cldr-24#TOC-Enhanced-units-structure

A new element specifies patterns for time durations involving combinations of hours, minutes, and seconds, such as "Video >length: 93:45".
or
These are intended to be used for constructing formats such as "2 hours, 5 minutes", "2 hrs, 5 mins", or "2h 5m"
Essentially it is similar to TemporalAmount: http://docs.oracle.com/javase/8/docs/api/java/time/temporal/TemporalAmount.html
in JSR 310, but unlike 310 there is no structural "array" of units in ICU4J.
Instead, e.g. MeasureFormat: http://icu-project.org/apiref/icu4j/com/ibm/icu/text/MeasureFormat.html allows formatting more than one measurement:
MeasureFormat fmtEn = MeasureFormat.getInstance(ULocale.ENGLISH, FormatWidth.WIDE);
// Output: 1 inch, 2 feet
fmtEn.formatMeasures(
new Measure(1, MeasureUnit.INCH),
new Measure(2, MeasureUnit.FOOT));
So it could be handled by Formatting/Parsing similar to ICU4J, where at most an array or collection of individual measurements is used, or via a structural type similar to JSR 310. I don't think we should overcomplicate the Measurement/Quantity type similar to TemporalAmount, but as with Range it could be provided in an optional module (or even just on RI level) if there's value to it.

@keilw keilw added the ready label Mar 4, 2015
@keilw keilw removed the ready label Jun 2, 2017
@keilw keilw added the deferred Could be done later label May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant