You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Gerald Wiltse <je...@gmail.com> on 2016/02/18 18:26:29 UTC

Groovy Extension Method - Collection or GroovyMbean

I want to do a bunch of calculations and combinations around collections of
GroovyMbeans.  I want to add these "Functions/Formulas" as methods.  Would
it be wiser to add these to the ArrayList class, or to GroovyMbean class?

Regards,
Jerry

Gerald R. Wiltse
jerrywiltse@gmail.com

Re: Groovy Extension Method - Collection or GroovyMbean

Posted by Gerald Wiltse <je...@gmail.com>.
I really like the GPath idea, sadly, i have many other math functions
besides sum that i need to use, so I'll put it on LIST and not arraylist.
Thank you!

Gerald R. Wiltse
jerrywiltse@gmail.com


On Thu, Feb 18, 2016 at 2:28 PM, Alexander Klein <in...@aklein.org> wrote:

> If your calculations need the List, put it to List, not the ArrayList, but
> check inside if all elements are of type GroovyMbeans.
> If you can go with GPath like e.g. list.doIt().sum() that returns a List
> with all the results of doIt and then sums it, then put it to GroovyMbeans
> directly.
>
> Regards,
> Sascha
>
>
> Am 18.02.2016 um 18:26 schrieb Gerald Wiltse:
>
> I want to do a bunch of calculations and combinations around collections
> of GroovyMbeans.  I want to add these "Functions/Formulas" as methods.
> Would it be wiser to add these to the ArrayList class, or to GroovyMbean
> class?
>
> Regards,
> Jerry
>
> Gerald R. Wiltse
> jerrywiltse@gmail.com
>
>
>

Re: Groovy Extension Method - Collection or GroovyMbean

Posted by Alexander Klein <in...@aklein.org>.
If your calculations need the List, put it to List, not the ArrayList,
but check inside if all elements are of type GroovyMbeans.
If you can go with GPath like e.g. list.doIt().sum() that returns a List
with all the results of doIt and then sums it, then put it to
GroovyMbeans directly.

Regards,
Sascha

Am 18.02.2016 um 18:26 schrieb Gerald Wiltse:
> I want to do a bunch of calculations and combinations around
> collections of GroovyMbeans.  I want to add these "Functions/Formulas"
> as methods.  Would it be wiser to add these to the ArrayList class, or
> to GroovyMbean class?
>
> Regards,
> Jerry
>
> Gerald R. Wiltse
> jerrywiltse@gmail.com <ma...@gmail.com>
>