Bikeshed: what do we call the distinguished method of a SAM?

Brian Goetz brian.goetz at oracle.com
Tue Jul 2 12:44:42 PDT 2013


Working on the spec for the SAMs.  In consultation with Doug, converging 
on a style that casts a SAM as *representing* an abstract entity such as 
a function or operation, and treating the SAM *as if* it were that 
function.  For example:

/**
  * Represents a function that accepts one argument and produces a result.
  *
  * @param <T> the type of the input to the function
  * @param <R> the type of the result of the function
  *
  * @since 1.8
  */
@FunctionalInterface
public interface Function<T, R> {

     /**
      * Applies this function to an argument.
      *
      * @param t the function argument
      * @return the function result
      */
     R apply(T t);

I think one thing that is missing is tying together the sole SAM method 
with the SAM class.  This is obvious in a SAM with no default or static 
methods (and no methods from Object), but starts to get lost in the 
noise as the method count adds up.

I'm thinking of something like:

  * This is a <a href="...">functional interface</a> whose _____ method 
is {@link #apply}.

For some value of ____.  What do we call the primary SAM method?  The 
implementation method?  The primary SAM method?  The abstract method?



More information about the lambda-libs-spec-observers mailing list