Example usage for java.util.function IntUnaryOperator compose

List of usage examples for java.util.function IntUnaryOperator compose

Introduction

In this page you can find the example usage for java.util.function IntUnaryOperator compose.

Prototype

default IntUnaryOperator compose(IntUnaryOperator before) 

Source Link

Document

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

Usage

From source file:Main.java

public static void main(String[] args) {
    IntUnaryOperator i = (x) -> x * x;
    System.out.println(i.compose(i).applyAsInt(2));
}

From source file:Main.java

public static void main(String[] args) {
    IntUnaryOperator i = IntUnaryOperator.identity();
    System.out.println(i.compose(i).applyAsInt(2));
}