Example usage for java.util.function DoubleUnaryOperator andThen

List of usage examples for java.util.function DoubleUnaryOperator andThen

Introduction

In this page you can find the example usage for java.util.function DoubleUnaryOperator andThen.

Prototype

default DoubleUnaryOperator andThen(DoubleUnaryOperator after) 

Source Link

Document

Returns a composed operator that first applies this operator to its input, and then applies the after operator to the result.

Usage

From source file:Main.java

public static void main(String[] args) {
    DoubleUnaryOperator square = (x) -> {
        return x * x;
    };/*  w w  w . java2s  .  c o  m*/

    DoubleUnaryOperator doubleValue = (x) -> {
        return 2 * x;
    };

    System.out.println(doubleValue.andThen(square).applyAsDouble(3.14));
}