JSR 275 - Units, Percent per second
- by I82Much
Hi all,
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<Dimensionless> PERCENT_PER_SECOND = NonSI.PERCENT.divide(Si.SECOND).asType(Dimensionless.class)
but I am getting a ClassCastException when I try to do that.
The following works, but I'm not sure if there's a better way:
public interface PercentOverTime extends Quantity {}
public static Unit<PercentOverTime> PERCENT_PER_SECOND = new BaseUnit<PercentOverTime>("%/s");
Any thoughts? The closest I could find to this is the question on Cooking Measurements (which is how I saw how to define your own units).