Stay organized with collections
Save and categorize content based on your preferences.
ToIntFunction
public
interface
ToIntFunction
java.util.function.ToIntFunction<T>
|
Represents a function that produces an int-valued result. This is the
int
-producing primitive specialization for Function
.
This is a functional interface
whose functional method is applyAsInt(java.lang.Object)
.
Summary
Public methods |
abstract
int
|
applyAsInt(T value)
Applies this function to the given argument.
|
Public methods
applyAsInt
public abstract int applyAsInt (T value)
Applies this function to the given argument.
Parameters |
value |
T : the function argument |
Returns |
int |
the function result |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ToIntFunction\n\nAdded in [API level 24](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nToIntFunction\n=============\n\n\n`\npublic\n\n\ninterface\nToIntFunction\n`\n\n\n`\n\n\n`\n\n|---------------------------------------|\n| java.util.function.ToIntFunction\\\u003cT\\\u003e |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nRepresents a function that produces an int-valued result. This is the\n`int`-producing primitive specialization for [Function](/reference/java/util/function/Function).\n\nThis is a [functional interface](/reference/java/util/function/package-summary)\nwhose functional method is [applyAsInt(java.lang.Object)](/reference/java/util/function/ToIntFunction#applyAsInt(T)). \n**See also:**\n\n- [Function](/reference/java/util/function/Function)\n\nSummary\n-------\n\n| ### Public methods ||\n|-----------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract int` | ` `[applyAsInt](/reference/java/util/function/ToIntFunction#applyAsInt(T))`(T value) ` Applies this function to the given argument. |\n\nPublic methods\n--------------\n\n### applyAsInt\n\nAdded in [API level 24](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract int applyAsInt (T value)\n```\n\nApplies this function to the given argument.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|-----------------------------------|\n| `value` | `T`: the function argument \u003cbr /\u003e |\n\n| Returns ||\n|-------|----------------------------|\n| `int` | the function result \u003cbr /\u003e |"]]