Use Advanced Search to search the entire archive.
Re: Remove "generic" multiply/divide operations from Quantity
- From: Martin Desruisseaux <
>
- To:
- Subject: Re: Remove "generic" multiply/divide operations from Quantity
- Date: Sat, 18 Oct 2014 18:10:39 +0900
- Organization: Geomatys
Le 17/10/14 13:02, Werner Keil a écrit :
>
asType() which allows guidance (similar to a non-wildcard proposed)
>
can be tricked and tweaked any way you want, too.
>
>
Unit<InformationRate> POUND_FORCE would work just the same if asType()
>
class and return subtype match, though it would mathematically or
>
physically make no sense;-)
>
No Werner. We wrote Unit.asType(Class) in such a way that, if the type
doesn't match, it throw a ClassCastException at runtime.
Are you aware of the Class.asSubclass(Class<U> clazz) standard method?
Our Unit.asType(Class) method follows a similar idea.
Martin