-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java Unit types missing mult(U)
functions
#7156
Comments
So, a caveat to this is type erasure (of course) with combinatory units and their subclasses. Something like this wouldn't be possible: public class Per<N extends Unit, D extends Unit> extends Unit {
N mult(D denom) { ... }
<Other extends Unit> MultUnit<? extends Per<N, D>, Other> mult(Other other) { ... }
} Because But basic non-combinatory types like voltage and angle should be fine. My main concern would be lack of consistency, like having only some units support |
Given that |
It looks like all the Java unit types have
per(U)
functions, but many of them are missing genericmult(U)
functions. For now, users can useMultUnit.combine(a, b)
, but it would be nice if users could directly do something likeVolts.per(Rotation.mult(Second))
for all units (as I believe was the case with 2024 units).The text was updated successfully, but these errors were encountered: