软件包 | 描述 |
---|---|
java.security |
为安全框架提供类和接口。
|
java.util |
包含集合框架、遗留的集合类、事件模型、日期和时间的设施、国际化和各种实用工具类(一个字符串标记,一个随机数发生器,和一位阵列)。
|
java.util.concurrent |
在并发编程中常用的实用类。
|
java.util.function |
功能接口提供目标类型的lambda表达式和方法参考。
|
java.util.stream |
类,以支持元素流上的功能样式操作,如Map减少集合上的转换。
|
Modifier and Type | Method and Description |
---|---|
Object |
Provider.computeIfAbsent(Object key, Function<? super Object,? extends Object> mappingFunction)
如果指定的键是不是已经与价值相关的(或映射到
null ),尝试使用给定的映射功能,进入到这个Map除非
null 计算其价值。
|
Modifier and Type | Method and Description |
---|---|
static <T,U extends Comparable<? super U>> |
Comparator.comparing(Function<? super T,? extends U> keyExtractor)
|
static <T,U> Comparator<T> |
Comparator.comparing(Function<? super T,? extends U> keyExtractor, Comparator<? super U> keyComparator)
|
V |
HashMap.computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction) |
V |
Hashtable.computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction) |
default V |
Map.computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
如果指定的键是不是已经与价值相关的(或映射到
null ),尝试使用给定的映射功能,进入到这个Map除非
null 计算其价值。
|
<U> Optional<U> |
Optional.flatMap(Function<? super T,Optional<U>> mapper)
如果一个值是存在的,将提供
Optional -bearing映射函数,返回结果,否则返回一个空
Optional 。
|
<U> Optional<U> |
Optional.map(Function<? super T,? extends U> mapper)
如果一个值是存在的,申请提供的映射函数,如果结果不为空,返回一个
Optional 描述结果。
|
default <U extends Comparable<? super U>> |
Comparator.thenComparing(Function<? super T,? extends U> keyExtractor)
返回一个具有提取
Comparable 排序关键字功能字典序比较。
|
default <U> Comparator<T> |
Comparator.thenComparing(Function<? super T,? extends U> keyExtractor, Comparator<? super U> keyComparator)
返回一个给定的
Comparator 提取物是比较关键的功能字典序比较。
|
Modifier and Type | Method and Description |
---|---|
<U> CompletionStage<U> |
CompletionStage.applyToEither(CompletionStage<? extends T> other, Function<? super T,U> fn)
返回一个新的completionstage,当这种或其他特定阶段的正常完成,执行相应的结果作为参数提供的功能。
|
<U> CompletableFuture<U> |
CompletableFuture.applyToEither(CompletionStage<? extends T> other, Function<? super T,U> fn) |
<U> CompletionStage<U> |
CompletionStage.applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T,U> fn)
返回一个新的completionstage,当这种或其他特定阶段的正常完成,利用这个阶段的默认的异步执行机构执行,与相应的结果作为参数提供的功能。
|
<U> CompletableFuture<U> |
CompletableFuture.applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T,U> fn) |
<U> CompletionStage<U> |
CompletionStage.applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T,U> fn, Executor executor)
返回一个新的completionstage,当这种或其他特定阶段的正常完成,使用提供的遗嘱执行人执行,与相应的结果作为参数提供的功能。
|
<U> CompletableFuture<U> |
CompletableFuture.applyToEitherAsync(CompletionStage<? extends T> other, Function<? super T,U> fn, Executor executor) |
V |
ConcurrentSkipListMap.computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
如果指定的键是不是已经与一个值关联,试图使用给定的映射功能,进入到这个Map除非
null 计算其价值。
|
default V |
ConcurrentMap.computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
如果指定的键是不是已经与价值相关的(或映射到
null ),尝试使用给定的映射功能,进入到这个Map除非
null 计算其价值。
|
V |
ConcurrentHashMap.computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
如果指定的键是不是已经与一个值关联,试图使用给定的映射功能,进入到这个Map除非
null 计算其价值。
|
CompletionStage<T> |
CompletionStage.exceptionally(Function<Throwable,? extends T> fn)
返回一个新的completionstage,当此阶段完成异常,执行这一阶段的异常作为参数提供的功能。
|
CompletableFuture<T> |
CompletableFuture.exceptionally(Function<Throwable,? extends T> fn)
返回一个新的completablefuture,完成这completablefuture完成时,随着异常触发这completablefuture完成时完成给定的功能异常的结果;否则,如果这completablefuture正常结束,然后返回completablefuture也正常完成相同的值的。
|
<U> void |
ConcurrentHashMap.forEachEntry(long parallelismThreshold, Function<Map.Entry<K,V>,? extends U> transformer, Consumer<? super U> action)
对每个条目的每个非空转换执行给定的操作。
|
<U> void |
ConcurrentHashMap.forEachKey(long parallelismThreshold, Function<? super K,? extends U> transformer, Consumer<? super U> action)
对每个键的每个非空转换执行给定的操作。
|
<U> void |
ConcurrentHashMap.forEachValue(long parallelismThreshold, Function<? super V,? extends U> transformer, Consumer<? super U> action)
对每个值的每个非空转换执行给定的操作。
|
<U> U |
ConcurrentHashMap.reduceEntries(long parallelismThreshold, Function<Map.Entry<K,V>,? extends U> transformer, BiFunction<? super U,? super U,? extends U> reducer)
返回积累给定的转换所有条目使用给定的减速器结合值,或为空,如果没有的结果。
|
<U> U |
ConcurrentHashMap.reduceKeys(long parallelismThreshold, Function<? super K,? extends U> transformer, BiFunction<? super U,? super U,? extends U> reducer)
返回累积给定的转换所有键的结果,使用给定的减速器组合值,或为零,如果没有。
|
<U> U |
ConcurrentHashMap.reduceValues(long parallelismThreshold, Function<? super V,? extends U> transformer, BiFunction<? super U,? super U,? extends U> reducer)
返回累积给定的所有值转换的结果,使用给定的减速器组合值,或为零,如果没有。
|
<U> U |
ConcurrentHashMap.searchEntries(long parallelismThreshold, Function<Map.Entry<K,V>,? extends U> searchFunction)
返回一个非空的结果,从应用在每个条目上的给定的搜索功能,或为空,如果没有。
|
<U> U |
ConcurrentHashMap.searchKeys(long parallelismThreshold, Function<? super K,? extends U> searchFunction)
返回一个非空的结果,从应用在每个键上的给定的搜索功能,或为空,如果没有。
|
<U> U |
ConcurrentHashMap.searchValues(long parallelismThreshold, Function<? super V,? extends U> searchFunction)
返回一个非空的结果,从应用给定的搜索功能上的每个值,或空,如果没有。
|
<U> CompletionStage<U> |
CompletionStage.thenApply(Function<? super T,? extends U> fn)
返回一个新的completionstage,当此阶段完成正常的情况下,执行这一阶段的结果作为参数提供的功能。
|
<U> CompletableFuture<U> |
CompletableFuture.thenApply(Function<? super T,? extends U> fn) |
<U> CompletionStage<U> |
CompletionStage.thenApplyAsync(Function<? super T,? extends U> fn)
返回一个新的completionstage,当此阶段完成这个阶段通常使用默认的异步执行机构执行,这一阶段的结果作为参数提供的功能。
|
<U> CompletableFuture<U> |
CompletableFuture.thenApplyAsync(Function<? super T,? extends U> fn) |
<U> CompletionStage<U> |
CompletionStage.thenApplyAsync(Function<? super T,? extends U> fn, Executor executor)
返回一个新的completionstage,当此阶段完成通常是使用提供的遗嘱执行人执行,这个阶段的结果作为参数提供的功能。
|
<U> CompletableFuture<U> |
CompletableFuture.thenApplyAsync(Function<? super T,? extends U> fn, Executor executor) |
<U> CompletionStage<U> |
CompletionStage.thenCompose(Function<? super T,? extends CompletionStage<U>> fn)
返回一个新的completionstage,当此阶段完成正常的情况下,执行这一阶段作为参数提供的功能。
|
<U> CompletableFuture<U> |
CompletableFuture.thenCompose(Function<? super T,? extends CompletionStage<U>> fn) |
<U> CompletionStage<U> |
CompletionStage.thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn)
返回一个新的completionstage,当此阶段完成这个阶段通常使用默认的异步执行机构执行,这个阶段作为参数提供的功能。
|
<U> CompletableFuture<U> |
CompletableFuture.thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn) |
<U> CompletionStage<U> |
CompletionStage.thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn, Executor executor)
返回一个新的completionstage,当此阶段完成通常是使用提供的遗嘱执行人执行,这个阶段的结果作为参数提供的功能。
|
<U> CompletableFuture<U> |
CompletableFuture.thenComposeAsync(Function<? super T,? extends CompletionStage<U>> fn, Executor executor) |
Modifier and Type | Interface and Description |
---|---|
interface |
UnaryOperator<T>
表示一个操作在一个操作数,它产生一个与它的操作数相同的结果的结果。
|
Modifier and Type | Method and Description |
---|---|
default <V> Function<T,V> |
Function.andThen(Function<? super R,? extends V> after)
返回一个由功能首次采用该函数的输入,然后将
after 函数的结果。
|
default <V> Function<V,R> |
Function.compose(Function<? super V,? extends T> before)
返回一个由功能,首先应用
before 函数的输入,然后将该函数的结果。
|
static <T> Function<T,T> |
Function.identity()
返回一个函数,它总是返回它的输入参数。
|
Modifier and Type | Method and Description |
---|---|
default <V> Function<T,V> |
Function.andThen(Function<? super R,? extends V> after)
返回一个由功能首次采用该函数的输入,然后将
after 函数的结果。
|
default <V> BiFunction<T,U,V> |
BiFunction.andThen(Function<? super R,? extends V> after)
返回一个由功能首次采用该函数的输入,然后将
after 函数的结果。
|
default <V> Function<V,R> |
Function.compose(Function<? super V,? extends T> before)
返回一个由功能,首先应用
before 函数的输入,然后将该函数的结果。
|
Modifier and Type | Method and Description |
---|---|
Function<A,R> |
Collector.finisher()
从中间堆积型
A 到最终的结果
R 型执行最终的转化。
|
Modifier and Type | Method and Description |
---|---|
static <T,A,R,RR> Collector<T,A,RR> |
Collectors.collectingAndThen(Collector<T,A,R> downstream, Function<R,RR> finisher)
适应
Collector 执行一个额外的加工转化。
|
<R> Stream<R> |
Stream.flatMap(Function<? super T,? extends Stream<? extends R>> mapper)
返回由将所提供的映射函数应用到每个元素的映射流的内容替换此流的每个元素的结果的结果流。
|
DoubleStream |
Stream.flatMapToDouble(Function<? super T,? extends DoubleStream> mapper)
返回一个包含有一个映射的流应用提供的映射功能,每个元件产生的内容替换此流的每个元素的结果
DoubleStream 。
|
IntStream |
Stream.flatMapToInt(Function<? super T,? extends IntStream> mapper)
返回一个包含有一个映射的流应用提供的映射功能,每个元件产生的内容替换此流的每个元素的结果
IntStream 。
|
LongStream |
Stream.flatMapToLong(Function<? super T,? extends LongStream> mapper)
返回一个包含有一个映射的流应用提供的映射功能,每个元件产生的内容替换此流的每个元素的结果
LongStream 。
|
static <T,K> Collector<T,?,Map<K,List<T>>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier)
返回一个
Collector 实行“组”操作的输入元素类型
T ,分组元素按一个分类函数,返回的结果在
Map 。
|
static <T,K,A,D> Collector<T,?,Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier, Collector<? super T,A,D> downstream)
返回一个实现级联的“组”操作
Collector
T 型输入元素,元素分组根据分类功能,然后执行还原操作对一个给定的键使用指定的下游
Collector 关联的值。
|
static <T,K,D,A,M extends Map<K,D>> |
Collectors.groupingBy(Function<? super T,? extends K> classifier, Supplier<M> mapFactory, Collector<? super T,A,D> downstream)
返回一个实现级联的“组”操作
Collector
T 型输入元素,元素分组根据分类功能,然后执行还原操作对一个给定的键使用指定的下游
Collector 关联的值。
|
static <T,K> Collector<T,?,ConcurrentMap<K,List<T>>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier)
返回一个并发
Collector 实行“组”操作的输入元素类型
T ,分组元素按照分类功能。
|
static <T,K,A,D> Collector<T,?,ConcurrentMap<K,D>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier, Collector<? super T,A,D> downstream)
返回一个
Collector 实施并行级联”组的“
T 型要素投入运作,分组元素按一个分类函数,然后执行还原操作对一个给定的键使用指定的下游
Collector 关联的值。
|
static <T,K,A,D,M extends ConcurrentMap<K,D>> |
Collectors.groupingByConcurrent(Function<? super T,? extends K> classifier, Supplier<M> mapFactory, Collector<? super T,A,D> downstream)
返回一个
Collector 实施并行级联”组的“
T 型要素投入运作,分组元素按一个分类函数,然后执行还原操作对一个给定的键使用指定的下游
Collector 关联的值。
|
<R> Stream<R> |
Stream.map(Function<? super T,? extends R> mapper)
返回一个流,包括将给定函数应用到该流元素的结果。
|
static <T,U,A,R> Collector<T,?,R> |
Collectors.mapping(Function<? super T,? extends U> mapper, Collector<? super U,A,R> downstream)
适应
Collector 接受型
U 元素之一接受元素类型
T 应用映射功能,每个输入元素之前的积累。
|
static <T,A,R> Collector<T,A,R> |
Collector.of(Supplier<A> supplier, BiConsumer<A,T> accumulator, BinaryOperator<A> combiner, Function<A,R> finisher, Collector.Characteristics... characteristics)
返回一个新的
Collector 由给定的
supplier ,
accumulator ,
combiner 描述,和
finisher 功能。
|
static <T,U> Collector<T,?,U> |
Collectors.reducing(U identity, Function<? super T,? extends U> mapper, BinaryOperator<U> op)
返回一个
Collector 执行指定的映射功能和
BinaryOperator 下减少其投入要素。
|
static <T,K,U> Collector<T,?,ConcurrentMap<K,U>> |
Collectors.toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper)
返回一个并发
Collector 积累成
ConcurrentMap 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U> Collector<T,?,ConcurrentMap<K,U>> |
Collectors.toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper)
返回一个并发
Collector 积累成
ConcurrentMap 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U> Collector<T,?,ConcurrentMap<K,U>> |
Collectors.toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction)
返回一个并发
Collector 积累成
ConcurrentMap 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U> Collector<T,?,ConcurrentMap<K,U>> |
Collectors.toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction)
返回一个并发
Collector 积累成
ConcurrentMap 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U,M extends ConcurrentMap<K,U>> |
Collectors.toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction, Supplier<M> mapSupplier)
返回一个并发
Collector 积累成
ConcurrentMap 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U,M extends ConcurrentMap<K,U>> |
Collectors.toConcurrentMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction, Supplier<M> mapSupplier)
返回一个并发
Collector 积累成
ConcurrentMap 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U> Collector<T,?,Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper)
返回一个
Collector 积累成一个
Map 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U> Collector<T,?,Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper)
返回一个
Collector 积累成一个
Map 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U> Collector<T,?,Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction)
返回一个
Collector 积累成一个
Map 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U> Collector<T,?,Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction)
返回一个
Collector 积累成一个
Map 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U,M extends Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction, Supplier<M> mapSupplier)
返回一个
Collector 积累成一个
Map 元素的键和值是应用提供的函数映射到输入元素的结果。
|
static <T,K,U,M extends Map<K,U>> |
Collectors.toMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper, BinaryOperator<U> mergeFunction, Supplier<M> mapSupplier)
返回一个
Collector 积累成一个
Map 元素的键和值是应用提供的函数映射到输入元素的结果。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.