Most visited

Recently visited

Added in API level 24

DoubleStream.Builder

public static interface DoubleStream.Builder
implements DoubleConsumer

java.util.stream.DoubleStream.Builder


DoubleStream可变建设者。

流生成器具有生命周期,该生命周期始于构建阶段,在此阶段中可以添加元素,然后过渡到构建阶段,之后可能不会添加元素。 构建阶段在调用build()方法时开始,该方法创建一个有序流,其元素是按照添加顺序添加到流构建器的元素。

也可以看看:

摘要(Summary)

公共方法(Public methods)

abstract void accept(double t)

为正在构建的流添加一个元素。

default DoubleStream.Builder add(double t)

为正在构建的流添加一个元素。

abstract DoubleStream build()

构建流,将此构建器转换为构建状态。

继承方法(Inherited methods)

From interface java.util.function.DoubleConsumer

公共方法(Public methods)

accept

Added in API level 24
void accept (double t)

为正在构建的流添加一个元素。

参数(Parameters)
t double: the input argument
抛出异常(Throws)
IllegalStateException if the builder has already transitioned to the built state

add

Added in API level 24
DoubleStream.Builder add (double t)

为正在构建的流添加一个元素。

实现要求:
  • The default implementation behaves as if:
    accept(t)
         return this;
     
参数(Parameters)
t double: the element to add
返回(Returns)
DoubleStream.Builder this builder
抛出异常(Throws)
IllegalStateException if the builder has already transitioned to the built state

build

Added in API level 24
DoubleStream build ()

构建流,将此构建器转换为构建状态。 如果在构建器进入构建状态后还有更多尝试在构建器上进行操作,则会抛出IllegalStateException

返回(Returns)
DoubleStream the built stream
抛出异常(Throws)
IllegalStateException if the builder has already transitioned to the built state

Hooray!