Serializable, Comparable<Collector.Characteristics>public static enum Collector.Characteristics extends Enum<Collector.Characteristics>
Collector, which can
be used to optimize reduction implementations.| 枚举常量 | 说明 |
|---|---|
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.
|
IDENTITY_FINISH |
Indicates that the finisher function is the identity function and
can be elided.
|
UNORDERED |
Indicates that the collection operation does not commit to preserving
the encounter order of input elements.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static Collector.Characteristics |
valueOf(String name) |
返回带有指定名称的该类型的枚举常量。
字符串必须与用于声明该类型的枚举常量的
标识符完全匹配。(不允许有多余
的空格字符。)
|
static Collector.Characteristics[] |
values() |
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。该方法可用于迭代
常量, 如下所示:
for (Collector.Characteristics c : Collector.Characteristics.values()) System.out.println(c); |
public static final Collector.Characteristics CONCURRENT
If a CONCURRENT collector is not also UNORDERED,
then it should only be evaluated concurrently if applied to an
unordered data source.
public static final Collector.Characteristics UNORDERED
Set.)public static final Collector.Characteristics IDENTITY_FINISH
public static Collector.Characteristics[] values()
for (Collector.Characteristics c : Collector.Characteristics.values()) System.out.println(c);
public static Collector.Characteristics valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值