开发者

How do you write your own custom measurement converters

开发者 https://www.devze.com 2023-01-26 20:03 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消