public static interface DoubleStream.Builder extends DoubleConsumer
DoubleStream
可变构建器。
流构建器具有生命周期,其从构建阶段开始,在该阶段期间可以添加元素,然后转换到内置阶段,之后可能不添加元素。 构建阶段从调用build()
方法开始,它创建一个有序流,其元素是添加到流构建器的元素,按照它们被添加的顺序。
DoubleStream.builder()
Modifier and Type | Method and Description |
---|---|
void |
accept(double t)
向要构建的流添加元素。
|
default DoubleStream.Builder |
add(double t)
向要构建的流添加元素。
|
DoubleStream |
build()
构建流,将此构建器转换为内置状态。
|
andThen
void accept(double t)
accept
在界面
DoubleConsumer
t
- 输入参数
IllegalStateException
- 如果构建器已经转换到内置状态
default DoubleStream.Builder add(double t)
accept(t) return this;
t
- 要添加的元素
this
建设者
IllegalStateException
- 如果构建器已经转换到内置状态
DoubleStream build()
IllegalStateException
。
IllegalStateException
- 如果构建器已经转换到内置状态
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.