unitsofmeasurement / unit-api

Units of Measurement API
http://unitsofmeasurement.github.io/unit-api/
Other
180 stars 42 forks source link

Improve the JavaDoc of UnitFormat #229

Closed keilw closed 3 years ago

keilw commented 3 years ago

Based on input by users the JavaDoc of UnitFormat, especially the label() method could be improved, based on e.g. the old JSR-108 version of it.

"Attaches a system-wide label to the specified unit. This method overrides the previous unit's label (e.g. label from unit database) as units may only have one label (but multiple aliases)." vanished after 108 was withdrawn, but except for the alias (as of now the API does not define an alias or an alias() method yet) this is a more precise way to say it than "If the specified label is already associated to a unit the previous association can be discarded or ignored." Especially "discarded" suggests the previous label would be removed which is not the case, so "overriden" or "overrides" feels better here. The rest especially the immutable part seems fine.