Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So this PR is based on feedback and discussion from PR #6710, #6696, #6684, #6676
I know some of those are mine. I will consider those dead and will leave them only for references to the feedback and notes.
I'm going to start with taking the existing units API and breaking it down into separate measurement type packages, angle, time, dimensionless, angularvelocity, etc.
Each will have an a class equivalent to the old Measure interface and ImmutableMeasure class which will handle immutable measures. (i.e. Angle)
Each will have a class that will handle the units of that type (i.e. AngleUnit)
Each class that handles Immutable measures will have a child class that handles mutable ones (i.e. MutableAngle).
At first (and probably at the end) many of the packages will be near duplicates of each other except for minor variations to handle division, multiplication, etc.
For the most part no generics will be used. They might come back in a limited form as this is further optimized, but no guarantees.
Every unit of a certain measurement type will have all of its derived units go back to the S.I. standard unit. As an example feet will be based on meters and inches will be based on meters. New units will not be based off of other ones unless that other one is the S.I. base (or derived as in the case of m/s). I've found it confusing when seeing the word base in the old API and not knowing if S.I. base or a unit that a new one is based on is used.
Units that are derived from the standard S.I. base units will be done so here as well much like the way AngularVelocity is done.
I'll not be focusing on UnitBuilder at this time. I'll effectively deprecate it. Though custom units of a type can still be created through the constructors and static methods of that type.
Of course feeback is welcome. I'll leave this in draft form until I've effectively replaced all of the existing units with the new setup.