Mmm... not sure. Perhaps it wouldn't be possible to implement it
without it being unsafe in all sorts of ways.

I'll play with the idea here (won't be until after the weekend) and if
I come up with anything worth looking at I'll let you know. By that
time you, Jody and Sergey might have solved it all anyway :)

Michael

On 1 July 2011 16:58, Andrea Aime <andrea.a...@geo-solutions.it> wrote:
> On Fri, Jul 1, 2011 at 5:40 AM, Michael Bedward
> <michael.bedw...@gmail.com> wrote:
>> Meanwhile, for Sergey's problem perhaps we could add a function
>> function to GeoTools: ie. a filter function that takes a user supplied
>> function, implementing some simple interface, as a parameter.
>
> The core of the problem is cloneability of that.
> The code that clones functions is this:
>
>        public Object visit(Function expression, Object extraData) {
>                List old = expression.getParameters();
>                Expression[] args = new Expression[old.size()];
>                int i = 0;
>                for (Iterator iter = old.iterator(); iter.hasNext(); i++) {
>                        Expression exp = (Expression) iter.next();
>                        args[i]= visit(exp, extraData);
>                }
>                return getFactory(extraData).function(expression.getName(), 
> args);
>        }
>
>        public Object visit(Literal expression, Object extraData) {
>                return getFactory(extraData).literal(expression.getValue());
>        }
>
> So let's say this delegate is stored in a literal so that it's still
> a parameter of tha main function. How would the function
> talk to the delegate? Passing down a array of objects?
>
> public interface FunctionDelegate {
>  Object doSomething(Object... params);
> }
>
> Cheers
> Andrea
>
> --
> -------------------------------------------------------
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax:      +39 0584 962313
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -------------------------------------------------------
>

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to