Skip to content

Conversation

@younies
Copy link
Member

@younies younies commented Sep 16, 2025

Add ConversionInfoToBase and update MeasureUnit for unit conversion support

  • Introduced ConversionInfoToBase class to encapsulate conversion details to base units.
  • Enhanced MeasureUnitImpl to include conversion information and updated the forIdentifier method to initialize it.
  • Added getConversionInfoToBase method in ConversionRates for retrieving conversion details.
  • Implemented conversion logic in MeasureUnit for converting between units, including handling of incompatible units with a new UnitsIncompatibleException.
  • Updated related classes to support the new conversion structure and ensure compatibility checks during conversions.

TODO: Please describe your changes here.

TODO: Please read the following on ICU Contributing, and then delete these instructions.

Thank you for your pull request!

TODO: Fill out the checklist below.

Checklist

  • Required: Issue filed: ICU-NNNNN
  • Required: The PR title must be prefixed with a JIRA Issue number. Example: "ICU-1234 Fix xyz"
  • Required: Each commit message must be prefixed with a JIRA Issue number. Example: "ICU-1234 Fix xyz"
  • Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • API docs and/or User Guide docs changed or added, if applicable

…upport

- Introduced ConversionInfoToBase class to encapsulate conversion details to base units.
- Enhanced MeasureUnitImpl to include conversion information and updated the forIdentifier method to initialize it.
- Added getConversionInfoToBase method in ConversionRates for retrieving conversion details.
- Implemented conversion logic in MeasureUnit for converting between units, including handling of incompatible units with a new UnitsIncompatibleException.
- Updated related classes to support the new conversion structure and ensure compatibility checks during conversions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant