Skip to main content

Re: Remove "generic" multiply/divide operations from Quantity

  • From: Martin Desruisseaux < >
  • To:
  • Subject: Re: Remove "generic" multiply/divide operations from Quantity
  • Date: Wed, 01 Oct 2014 00:35:09 +0200
  • Organization: Geomatys

Hello Werner

Le 01/10/14 00:28, Werner Keil a écrit :
> +1 on Martin's input, I tried to elaborate a bit on why I think it
> does not hurt.
> Specialized implementations are allowed to do stuff like 
>
>     public VolumeQuantity multiply(DistanceQuantity d1) {
>         AreaQuantity dq0 = convert(AreaUnit.sqmetre);
>         DistanceQuantity dq1 = d1.convert(DistanceUnit.m);
>         return new VolumeQuantity(dq0.units * dq1.units,
> VolumeUnit.cumetre);
>     }

However while specialized implementations are allowed, I don't think
they are needed. A single implementation can handle every standard
subtypes (Speed, Time, Length, etc.), provided that the QuantityFactory
implementation is complete enough.


> Martin, could you open a JIRA ticket for the suspect type issue on
> inverse, please?

As said in my previous email, I tried but JIRA seems partially down
tonight. Will try again tomorrow.

    Martin



Remove "generic" multiply/divide operations from Quantity

Otávio Gonçalves de Santana 09/30/2014

Re: Remove "generic" multiply/divide operations from Quantity

Martin Desruisseaux 09/30/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 09/30/2014

Re: Remove "generic" multiply/divide operations from Quantity

Martin Desruisseaux 09/30/2014

Re: Remove "generic" multiply/divide operations from Quantity

Werner Keil 09/30/2014
 
 
Close
loading
Please Confirm
Close