[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-2d-dev
Subject: Re: [OpenJDK 2D-Dev] 2D-related types that are candidates to be FunctionalInterfaces in JDK 8
From: Jim Graham <james.graham () oracle ! com>
Date: 2013-02-12 22:58:36
Message-ID: 511AC91C.1010603 () oracle ! com
[Download RAW message or body]
On 2/11/13 5:01 PM, Joseph Darcy wrote:
>> The pattern that would seem most useful is where the application
>> will need to iterate over a collection of these in parallel, is that
>> correct ?
>
> Not necessary. The guidance I would given is that candidate interfaces
> that are routinely instantiated today using anonymous classes should be
> annotated with @FunctionalInterface. Note that a compiler will allow
> one to use any type that meets the structural definition of a functional
> interface in a lambda expression; adding the @FunctionalInterface
> annotation just documents intent.
I think ImageObserver might be the closest to that criteria, but most
uses would tend to just use an AWT Component since that class already
provides a decent default implementation.
Stroke is out since that is used to implement a fairly extensive set of
calculations (the default BasicStroke implementation takes 3 or 4
classes of a hundred lines of code each to implement [counted from a
foggy memory], or the equivalent amount of native code in the non-open
JDK). I don't think there could be a simple "inlinable" implementation
of that interface.
I'll leave the printing and ImageIO interfaces to Phil or others to
comment on...
...jim
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic