Java.util.function.Function: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 18: Line 18:
}
}
</syntaxhighlight>
</syntaxhighlight>
=Primitive Type Functions=
* <tt>[https://docs.oracle.com/javase/8/docs/api/java/util/function/IntFunction.html IntFunction<T>]</tt> a function that receives an <tt>int</tt> argument and returns an argument of type T.
* <tt>[https://docs.oracle.com/javase/8/docs/api/java/util/function/ToIntFunction.html ToIntFunction<T></tt>] a function that receives an argument of type T and returns an <tt>int</tt>.


=Composition Methods=
=Composition Methods=

Revision as of 19:49, 29 March 2018

External

Internal

Overview

@FunctionalInterface
public interface Function<T, R> {

    R apply(T t);

    ....
}

Primitive Type Functions

  • IntFunction<T> a function that receives an int argument and returns an argument of type T.
  • ToIntFunction<T> a function that receives an argument of type T and returns an int.

Composition Methods