Interface IntBinaryOperator

All Superinterfaces:
BiFunction<Integer,​Integer,​Integer>, BiFunction<Integer,​Integer,​Integer>, BinaryOperator<Integer>, BinaryOperator<Integer>, IntBinaryOperator
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface
public interface IntBinaryOperator
extends BinaryOperator<Integer>, IntBinaryOperator
Represents an operation upon two int-valued operands and producing an int-valued result. This is the primitive type specialization of BinaryOperator for int.

This is a functional interface whose functional method is applyAsInt(int, int).

Since:
1.8
See Also:
BinaryOperator, IntUnaryOperator
  • Field Details

  • Method Details

    • applyAsInt

      int applyAsInt​(int left, int right)
      Applies this operator to the given operands.
      Specified by:
      applyAsInt in interface IntBinaryOperator
      Parameters:
      left - the first operand
      right - the second operand
      Returns:
      the operator result
    • apply

      default Integer apply​(Integer t, Integer u)
      Applies this function to the given arguments.
      Specified by:
      apply in interface BiFunction<Integer,​Integer,​Integer>
      Specified by:
      apply in interface BiFunction<Integer,​Integer,​Integer>
      Parameters:
      t - the first function argument
      u - the second function argument
      Returns:
      the function result
    • applyPartial

      default IntSupplier applyPartial​(int t, int u)
      Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
      Parameters:
      t - the first function argument
      u - the second function argument
      Returns:
      the function result
    • applyPartialL

      default IntUnaryOperator applyPartialL​(int t)
      Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
      Parameters:
      t - the function argument
      Returns:
      the function result
    • applyPartialR

      default IntUnaryOperator applyPartialR​(int u)
      Performs a partial application, resulting in a function that calls this with its argument and the argument given here.
      Parameters:
      u - the function argument
      Returns:
      the function result
    • consume

      default ObjIntConsumer<Integer> consume​(IntConsumer consumer)
      Consume a function.
      Parameters:
      consumer - The consumer to use in consuming.
      Returns:
      A Consumer which passes it's argument to this function and then passes the result into the given consumer.
    • map

      default IntBinaryOperator map​(IntUnaryOperator functor)
      Lift a function.
      Parameters:
      functor - The function to use in lifting.
      Returns:
      A function that passes the result of fn through a functor to produce a lifted function.