How do you write your own custom measurement converters
How do you write your own custo开发者_运维知识库m converters and specify the conversion factor using javax.measure packages. (e.g. Pint to gallons)
Well, I don't know the "correct" way to do it, but the obvious way would be to follow the pattern of the NonSI
class; i.e. create your own class containing statics for each unit, with values based on the standard definitions for the non-SI units in terms of SI units.
精彩评论