jdk/src/share/classes/java/util/function/IntFunction.java
changeset 16011 890a7ed97f6c
parent 15647 314007859004
child 17695 032254f2467b
equal deleted inserted replaced
16010:2727163b5df5 16011:890a7ed97f6c
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 package java.util.function;
    25 package java.util.function;
    26 
    26 
    27 /**
    27 /**
    28  * Apply a function to the input object yielding an appropriate {@code int}
    28  * Apply a function to the integer-valued input argument, yielding an
    29  * value; this is the {@code int}-bearing specialization for {@link Function}.
    29  * appropriate result. This is the {@code int}-consuming primitive
       
    30  * specialization for {@link Function}.
    30  *
    31  *
    31  * @param <T> the type of input objects to the function
    32  * @param <R> the type of output objects from the function
    32  *
    33  *
       
    34  * @see Function
    33  * @since 1.8
    35  * @since 1.8
    34  */
    36  */
    35 @FunctionalInterface
    37 @FunctionalInterface
    36 public interface IntFunction<T> {
    38 public interface IntFunction<R> {
    37 
    39 
    38     /**
    40     /**
    39      * Apply a function to the input object yielding an appropriate {@code int}
    41      * Compute the result of applying the function to the input argument
    40      * value.
       
    41      *
    42      *
    42      * @param t the input object
    43      * @param value the input value
    43      * @return the function result value
    44      * @return the function result
    44      */
    45      */
    45     public int applyAsInt(T t);
    46     public R apply(int value);
    46 }
    47 }