SAM Classes

Alex Blewitt alex.blewitt at gmail.com
Thu Jan 28 17:33:18 PST 2010


On Fri, Jan 29, 2010 at 1:25 AM, Joshua Bloch <jjb at google.com> wrote:
> From: Alex Blewitt <alex.blewitt at gmail.com>
>
> Date: Wed, Dec 16, 2009 at 1:06 AM
>> I did a scan of the Java class libraries (those with java.* or
>
> javax.*) - there's 100 interfaces and 220 classes which fall into this
>
> definition. Quite a lot more than I expected :-)

FWIW I think I was looking for cases where size(methods(class)) == 1,
rather than size(methods(class)-methods(Object)) == 1 which others
have suggested should be applicable for SAM conversion. This may be a
(small) underestimate, but as Joshua noted, there are plenty of other
SAM candidates in other open-source projects e.g. GCL's Predicate:

http://google-collections.googlecode.com/svn/trunk/javadoc/index.html?com/google/common/base/Predicate.html

Alex


More information about the lambda-dev mailing list