Class IntFunction

  • All Implemented Interfaces:
    Function<Integer>
    Direct Known Subclasses:
    IncIntFunction

    public abstract class IntFunction
    extends Object
    implements Function<Integer>
    A Function for primitives that accepts an argument of type int and returns a new value of the same type.

    The reason why IntFunction is an abstract class instead of an ordinary interface, is that this class doesn't cause any unwanted boxing of primitives version of the call method is used instead of the one that accepts and returns a/an Integer).

    This class is generated.

    • Constructor Detail

      • IntFunction

        public IntFunction()
    • Method Detail

      • call

        public abstract int call​(int current)
        Calculates the new value based on the current value.
        Parameters:
        current - the current value.
        Returns:
        the new value.
      • call

        public final Integer call​(Integer arg)
        Description copied from interface: Function
        Evaluates the function.
        Specified by:
        call in interface Function<Integer>
        Parameters:
        arg - the value to evaluate.
        Returns:
        the result of the evaluation