by mynameishere · 17y ago · 0 comments
public double foo(double x)
{
return x*x;
}
list=Utility.map(this,"foo",list);Might be worth the trade off in your case, but maybe not for the cases Google has in mind.
Google's approach, while more verbose, is a bit safer and more idiomatic.
I believe the more Java way would be to extend the List interface to add a map method and implement a corresponding class. To make this less of a pain, extend from one of the JDK provided classes if possible... but yes, it's still a pain.