Questions tagged [jsr-275]

JSR 275: Units Specification

Status: Rejected

JSR 275

11 questions
8
votes
3 answers

Unit of measurement API in Java?

JSR-275 has been rejected, the Units of Measurement API for Java project is a set of interfaces, but haven't found an open source implementation. On this post: Which jsr-275 units implementation should be used? the project owner mentions the…
CCC
  • 2,642
  • 7
  • 40
  • 62
4
votes
3 answers

JSR 275 - Units, Percent per second

I need to represent the unit of Percent per second using the JScience.org's JSR 275 units and measures implementation. I am trying to do to the following: Unit PERCENT_PER_SECOND =…
I82Much
  • 26,901
  • 13
  • 88
  • 119
2
votes
1 answer

How do you write your own custom measurement converters

How do you write your own custom converters and specify the conversion factor using javax.measure packages. (e.g. Pint to gallons)
Sam
  • 8,387
  • 19
  • 62
  • 97
2
votes
2 answers

Java units of measurement libraries other than JSR-275 and Units of Measure API

Are there any Java libraries dealing with units of measurement except for JSR 275 (rejected and abandoned) and Units of Measure API (which doesn't seem to have any production-quality implementations)?
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
1
vote
1 answer

JScience unit of measurement library incompatible with android

I have a use-case in my android application where I need to save a quantity, perform calculations on it, and display it in a unit of the user's choice (from a predefined list). JScience fit this need perfectly, but I cannot compile the application…
hxtk
  • 325
  • 1
  • 9
1
vote
1 answer

How to fetch the conversion factor for any unit conversion

When you convert between 2 entities, you usually do it via the UnitConverter. How should I find out what the conversion factor is? For example: public static final Unit KILOMETRE = METER.times(1000); public static final Unit
Sam
  • 8,387
  • 19
  • 62
  • 97
1
vote
1 answer

Javax.measure.quantity.Duration conversion issue

I am using javax.measure to convert user input to seconds that can vary anywhere from seconds to days, however converting from any unit to another doesn't work, here is what I have set up. String units = "d"; double value = 30.0; BaseUnit
pianoisland
  • 163
  • 1
  • 1
  • 10
1
vote
0 answers

How to use Eclipse UOMo (Units of Measurement) in standalone project?

I'm trying to use the UOMo java library in eclipse: http://www.eclipse.org/uomo I've installed it correctly (or at least I believe I have) via Help -> Install New Software..., dropped the repository link in, went through it all, was prompted to…
Andy
  • 3,228
  • 8
  • 40
  • 65
0
votes
1 answer

Setting an alias name on a ProductUnit fails to return that alias during serialization

Task I am trying to set an alias name on a UOM ProductUnitto allow the unit to be displayed in a human-friendly name in JSON/my frontend. The unit in question is "kg/h", so a mass-flow rate derived from the SI basic units "kg" and "s". However,…
Johannes Jander
  • 4,974
  • 2
  • 31
  • 46
0
votes
1 answer

JSR 275 javax.measure.Dimension string serialization and deserialization

The JSR of units of measurement 275 and 385 are rejected and not released, yet. However, they're the only sane way to work with units of measurement and dimensions, so I hope to get some insight into the following: I'd like to serialize and…
Kalle Richter
  • 8,008
  • 26
  • 77
  • 177
0
votes
1 answer

How can I change or override a factor defined in JScience library?

JScience library implementation uses a set of values for converting units to each other. I am not sure they are defined as constants. I would like to use my own conversion factor to convert meters to feet. Is there any way to accomplish that in…
The_Cute_Hedgehog
  • 1,280
  • 13
  • 22