@CanIgnoreReturnValue public static final class ImmutableDoubleArray.Builder extends Object
ImmutableDoubleArray
instances; obtained using ImmutableDoubleArray.builder(int)
.Modifier and Type | Method and Description |
---|---|
ImmutableDoubleArray.Builder |
add(double value)
Appends
value to the end of the values the built ImmutableDoubleArray will
contain. |
ImmutableDoubleArray.Builder |
addAll(Collection<Double> values)
Appends
values , in order, to the end of the values the built ImmutableDoubleArray will contain. |
ImmutableDoubleArray.Builder |
addAll(double[] values)
Appends
values , in order, to the end of the values the built ImmutableDoubleArray will contain. |
ImmutableDoubleArray.Builder |
addAll(ImmutableDoubleArray values)
Appends
values , in order, to the end of the values the built ImmutableDoubleArray will contain. |
ImmutableDoubleArray.Builder |
addAll(Iterable<Double> values)
Appends
values , in order, to the end of the values the built ImmutableDoubleArray will contain. |
ImmutableDoubleArray |
build()
Returns a new immutable array.
|
public ImmutableDoubleArray.Builder add(double value)
value
to the end of the values the built ImmutableDoubleArray
will
contain.public ImmutableDoubleArray.Builder addAll(double[] values)
values
, in order, to the end of the values the built ImmutableDoubleArray
will contain.public ImmutableDoubleArray.Builder addAll(Iterable<Double> values)
values
, in order, to the end of the values the built ImmutableDoubleArray
will contain.public ImmutableDoubleArray.Builder addAll(Collection<Double> values)
values
, in order, to the end of the values the built ImmutableDoubleArray
will contain.public ImmutableDoubleArray.Builder addAll(ImmutableDoubleArray values)
values
, in order, to the end of the values the built ImmutableDoubleArray
will contain.@CheckReturnValue public ImmutableDoubleArray build()
Performance note: the returned array is backed by the same array as the builder, so
no data is copied as part of this step, but this may occupy more memory than strictly
necessary. To copy the data to a right-sized backing array, use .build().trimmed()
.
Copyright © 2010–2020. All rights reserved.