Example usage for java.util.function IntUnaryOperator identity

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

Introduction

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

Prototype

static IntUnaryOperator identity() 

Source Link

Document

Returns a unary operator that always returns its input argument.

Usage

From source file:Main.java

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

From source file:org.briljantframework.array.AbstractIntArray.java

@Override
public int reduce(int identity, IntBinaryOperator reduce) {
    return reduce(identity, reduce, IntUnaryOperator.identity());
}