adds all elements produced by a TraversableOnce to this growable collection.
adds all elements produced by a TraversableOnce to this growable collection.
the TraversableOnce producing the elements to add.
the growable collection itself.
Adds a single element to the builder.
Adds a single element to the builder.
the element to be added.
the builder itself.
adds two or more elements to this growable collection.
adds two or more elements to this growable collection.
the first element to add.
the second element to add.
the remaining elements to add.
the growable collection itself
Returns true
if this combiner has a thread-safe +=
and is meant to be shared
across several threads constructing the collection.
Returns true
if this combiner has a thread-safe +=
and is meant to be shared
across several threads constructing the collection.
By default, this method returns false
.
Clears the contents of this builder.
Clears the contents of this builder. After execution of this method the builder will contain no elements.
Combines the contents of the receiver builder and the other
builder,
producing a new builder containing both their elements.
Combines the contents of the receiver builder and the other
builder,
producing a new builder containing both their elements.
This method may combine the two builders by copying them into a larger collection,
by producing a lazy view that gets evaluated once result
is invoked, or use
a merge operation specific to the data structure in question.
Note that both the receiver builder and other
builder become invalidated
after the invocation of this method, and should be cleared (see clear
)
if they are to be used again.
Also, combining two combiners c1
and c2
for which c1 eq c2
is true
, that is,
they are the same objects in memory:
c1.combine(c2)
always does nothing and returns c1
.
the type of elements contained by the other
builder
the type of collection produced by the other
builder
the other builder
the parallel builder containing both the elements of this and the other
builder
Returns string formatted according to given format
string.
Returns string formatted according to given format
string.
Format strings are as for String.format
(@see java.lang.String.format).
Creates a new builder by applying a transformation function to the results of this builder.
Creates a new builder by applying a transformation function to the results of this builder.
the type of collection returned by f
.
the transformation function.
a new builder which is the same as the current builder except that a transformation function is applied to this builder's result.
Produces a collection from the added elements.
Produces a collection from the added elements. The builder's contents are undefined after this operation.
a collection containing the elements added to this builder.
Constructs the result and sets the appropriate tasksupport object to the resulting collection if this is applicable.
Constructs the result and sets the appropriate tasksupport object to the resulting collection if this is applicable.
Gives a hint how many elements are expected to be added
when the next result
is called.
Gives a hint how many elements are expected to be added
when the next result
is called. Some builder classes
will optimize their representation based on the hint. However,
builder implementations are still required to work correctly even if the hint is
wrong, i.e. a different number of elements is added.
Gives a hint that one expects the result
of this builder
to have the same size as the given collection, plus some delta.
Gives a hint that one expects the result
of this builder
to have the same size as the given collection, plus some delta. This will
provide a hint only if the collection is known to have a cheap
size
method. Currently this is assumed to be the case if and only if
the collection is of type IndexedSeqLike
.
Some builder classes
will optimize their representation based on the hint. However,
builder implementations are still required to work correctly even if the hint is
wrong, i.e. a different number of elements is added.
the collection which serves as a hint for the result's size.
a correction to add to the coll.size
to produce the size hint.
Gives a hint that one expects the result
of this builder
to have the same size as the given collection, plus some delta.
Gives a hint that one expects the result
of this builder
to have the same size as the given collection, plus some delta. This will
provide a hint only if the collection is known to have a cheap
size
method. Currently this is assumed to be the case if and only if
the collection is of type IndexedSeqLike
.
Some builder classes
will optimize their representation based on the hint. However,
builder implementations are still required to work correctly even if the hint is
wrong, i.e. a different number of elements is added.
the collection which serves as a hint for the result's size.
Gives a hint how many elements are expected to be added
when the next result
is called, together with an upper bound
given by the size of some other collection.
Gives a hint how many elements are expected to be added
when the next result
is called, together with an upper bound
given by the size of some other collection. Some builder classes
will optimize their representation based on the hint. However,
builder implementations are still required to work correctly even if the hint is
wrong, i.e. a different number of elements is added.
the hint how many elements will be added.
the bounding collection. If it is an IndexedSeqLike, then sizes larger than collection's size are reduced.
An array combiner that uses doubling unrolled buffers to store elements.