Are there any open source libraries for representing cooking units such as Teaspoon and tablespoon in Java?
I have only found JSR-275 (https://jcp.org/en/jsr/detail?id=275) which is great but doesn’t know about cooking units.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
JScience is extensible, so you should be able to create a subclass of javax.measure.unit.SystemOfUnits. You’ll create a number of public static final declarations like this:
It’s pretty straightforward to define the other units and conversions, just as long as you know what the conversion factors are.