jdk/src/share/classes/java/util/function/Function.java
changeset 16011 890a7ed97f6c
parent 15647 314007859004
child 17695 032254f2467b
equal deleted inserted replaced
16010:2727163b5df5 16011:890a7ed97f6c
    22  * or visit www.oracle.com if you need additional information or have any
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 package java.util.function;
    25 package java.util.function;
    26 
    26 
       
    27 
    27 /**
    28 /**
    28  * Apply a function to the input object yielding an appropriate result object. A
    29  * Apply a function to the input argument, yielding an appropriate result.  A
    29  * function may variously provide a mapping between types, object instances or
    30  * function may variously provide a mapping between types, object instances or
    30  * keys and values or any other form of transformation upon the input.
    31  * keys and values or any other form of transformation upon the input.
    31  *
    32  *
    32  * @param <T> the type of input objects to the {@code apply} operation
    33  * @param <T> the type of the input to the {@code apply} operation.
    33  * @param <R> the type of result objects from the {@code apply} operation. May
    34  * @param <R> the type of the result of the {@code apply} operation.
    34  * be the same type as {@code <T>}.
       
    35  *
    35  *
    36  * @since 1.8
    36  * @since 1.8
    37  */
    37  */
    38 @FunctionalInterface
    38 @FunctionalInterface
    39 public interface Function<T, R> {
    39 public interface Function<T, R> {
    40 
    40 
    41     /**
    41     /**
    42      * Yield an appropriate result object for the input object.
    42      * Compute the result of applying the function to the input argument
    43      *
    43      *
    44      * @param t the input object
    44      * @param t the input object
    45      * @return the function result
    45      * @return the function result
    46      */
    46      */
    47     public R apply(T t);
    47     public R apply(T t);