Stay organized with collections
Save and categorize content based on your preferences.
IntFunction
public
interface
IntFunction
java.util.function.IntFunction<R>
|
Represents a function that accepts an int-valued argument and produces a
result. This is the int
-consuming primitive specialization for
Function
.
This is a functional interface
whose functional method is apply(int)
.
Summary
Public methods |
abstract
R
|
apply(int value)
Applies this function to the given argument.
|
Public methods
apply
public abstract R apply (int value)
Applies this function to the given argument.
Parameters |
value |
int : the function argument |
Returns |
R |
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# IntFunction\n\nAdded in [API level 24](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nIntFunction\n===========\n\n\n`\npublic\n\n\ninterface\nIntFunction\n`\n\n\n`\n\n\n`\n\n|-------------------------------------|\n| java.util.function.IntFunction\\\u003cR\\\u003e |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nRepresents a function that accepts an int-valued argument and produces a\nresult. This is the `int`-consuming primitive specialization for\n[Function](/reference/java/util/function/Function).\n\nThis is a [functional interface](/reference/java/util/function/package-summary)\nwhose functional method is [apply(int)](/reference/java/util/function/IntFunction#apply(int)). \n**See also:**\n\n- [Function](/reference/java/util/function/Function)\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------|-----------------------------------------------------------------------------------------------------------------------------|\n| ` abstract R` | ` `[apply](/reference/java/util/function/IntFunction#apply(int))`(int value) ` Applies this function to the given argument. |\n\nPublic methods\n--------------\n\n### apply\n\nAdded in [API level 24](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract R apply (int value)\n```\n\nApplies this function to the given argument.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|---------|-------------------------------------|\n| `value` | `int`: the function argument \u003cbr /\u003e |\n\n| Returns ||\n|-----|----------------------------|\n| `R` | the function result \u003cbr /\u003e |"]]