jdk/src/share/classes/java/util/function/UnaryOperator.java
changeset 16011 890a7ed97f6c
parent 15647 314007859004
child 17695 032254f2467b
equal deleted inserted replaced
16010:2727163b5df5 16011:890a7ed97f6c
    24  */
    24  */
    25 package java.util.function;
    25 package java.util.function;
    26 
    26 
    27 /**
    27 /**
    28  * An operation upon a single operand yielding a result. The operand and the
    28  * An operation upon a single operand yielding a result. The operand and the
    29  * result are of the same type.
    29  * result are of the same type. This is a specialization of {@code Function} for
       
    30  * the case where the operand and result are of the same type.
    30  *
    31  *
    31  * @param <T> the type of operand to {@code operate} and of the result
    32  * @param <T> the type of operand to {@code apply} and of the result
    32  *
    33  *
       
    34  * @see Function
    33  * @since 1.8
    35  * @since 1.8
    34  */
    36  */
    35 @FunctionalInterface
    37 @FunctionalInterface
    36 public interface UnaryOperator<T> {
    38 public interface UnaryOperator<T> extends Function<T, T> {
    37 
       
    38     /**
       
    39      * Returns the result of the operation upon the operand.
       
    40      *
       
    41      * @param operand the operand
       
    42      * @return the operation result
       
    43      */
       
    44     public T operate(T operand);
       
    45 }
    39 }