Stay organized with collections
Save and categorize content based on your preferences.
Characteristics
class Characteristics
Characteristics indicating properties of a Collector
, which can be used to optimize reduction implementations.
Summary
Enum values |
Indicates that this collector is concurrent, meaning that the result container can support the accumulator function being called concurrently with the same result container from multiple threads.
|
Indicates that the finisher function is the identity function and can be elided.
|
Indicates that the collection operation does not commit to preserving the encounter order of input elements.
|
Enum values
CONCURRENT
enum val CONCURRENT : Collector.Characteristics
Indicates that this collector is concurrent, meaning that the result container can support the accumulator function being called concurrently with the same result container from multiple threads.
If a CONCURRENT
collector is not also UNORDERED
, then it should only be evaluated concurrently if applied to an unordered data source.
IDENTITY_FINISH
enum val IDENTITY_FINISH : Collector.Characteristics
Indicates that the finisher function is the identity function and can be elided. If set, it must be the case that an unchecked cast from A to R will succeed.
UNORDERED
enum val UNORDERED : Collector.Characteristics
Indicates that the collection operation does not commit to preserving the encounter order of input elements. (This might be true if the result container has no intrinsic order, such as a Set
.)
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,["# Collector.Characteristics\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nCharacteristics\n===============\n\n```\nclass Characteristics\n```\n\n|---|---|-------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[java.util.stream.Collector.Characteristics](#)\\\u003e ||\n| | ↳ | [java.util.stream.Collector.Characteristics](#) |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [Collector.Characteristics.CONCURRENT](#ENUM_VALUE:CONCURRENT), [Collector.Characteristics.IDENTITY_FINISH](#ENUM_VALUE:IDENTITY_FINISH), [Collector.Characteristics.UNORDERED](#ENUM_VALUE:UNORDERED) |--------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Collector.Characteristics.CONCURRENT](#ENUM_VALUE:CONCURRENT) | Indicates that this collector is *concurrent*, meaning that the result container can support the accumulator function being called concurrently with the same result container from multiple threads. | | [Collector.Characteristics.IDENTITY_FINISH](#ENUM_VALUE:IDENTITY_FINISH) | Indicates that the finisher function is the identity function and can be elided. | | [Collector.Characteristics.UNORDERED](#ENUM_VALUE:UNORDERED) | Indicates that the collection operation does not commit to preserving the encounter order of input elements. | |\n\nCharacteristics indicating properties of a `Collector`, which can be used to optimize reduction implementations.\n\nSummary\n-------\n\n| Enum values ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [CONCURRENT](#ENUM_VALUE:CONCURRENT) Indicates that this collector is *concurrent*, meaning that the result container can support the accumulator function being called concurrently with the same result container from multiple threads. |\n| [IDENTITY_FINISH](#ENUM_VALUE:IDENTITY_FINISH) Indicates that the finisher function is the identity function and can be elided. |\n| [UNORDERED](#ENUM_VALUE:UNORDERED) Indicates that the collection operation does not commit to preserving the encounter order of input elements. |\n\nEnum values\n-----------\n\n### CONCURRENT\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val CONCURRENT : Collector.Characteristics\n```\n\nIndicates that this collector is *concurrent*, meaning that the result container can support the accumulator function being called concurrently with the same result container from multiple threads.\n\nIf a `CONCURRENT` collector is not also `UNORDERED`, then it should only be evaluated concurrently if applied to an unordered data source. \n\n### IDENTITY_FINISH\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val IDENTITY_FINISH : Collector.Characteristics\n```\n\nIndicates that the finisher function is the identity function and can be elided. If set, it must be the case that an unchecked cast from A to R will succeed. \n\n### UNORDERED\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val UNORDERED : Collector.Characteristics\n```\n\nIndicates that the collection operation does not commit to preserving the encounter order of input elements. (This might be true if the result container has no intrinsic order, such as a [Set](../Set.html#).)"]]