abstract class ImmutableBuilder[-A, C] extends ReusableBuilder[A, C]
Reusable builder for immutable collections
- Alphabetic
- By Inheritance
- ImmutableBuilder
- ReusableBuilder
- Builder
- Growable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ImmutableBuilder(empty: C)
Abstract Value Members
-
abstract
def
add(elem: A): ImmutableBuilder.this.type
${Add}s a single element to this $coll.
${Add}s a single element to this $coll.
- elem
the element to $add.
- returns
the $coll itself
- Definition Classes
- Growable
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
++=(xs: IterableOnce[A]): ImmutableBuilder.this.type
Alias for
addAllInPlaceAlias for
addAllInPlace- Definition Classes
- Growable
- Annotations
- @inline()
-
final
def
+=(elem1: A, elem2: A, elems: A*): ImmutableBuilder.this.type
${Add}s two or more elements to this $coll.
${Add}s two or more elements to this $coll.
- elem1
the first element to $add.
- elem2
the second element to $add.
- elems
the remaining elements to $add.
- returns
the $coll itself
- Definition Classes
- Growable
- Annotations
- @inline()
-
final
def
+=(elem: A): ImmutableBuilder.this.type
Alias for
addAlias for
add- Definition Classes
- Growable
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
addAll(xs: IterableOnce[A]): ImmutableBuilder.this.type
${Add}s all elements produced by a TraversableOnce to this $coll.
${Add}s all elements produced by a TraversableOnce to this $coll.
- xs
the TraversableOnce producing the elements to $add.
- returns
the $coll itself.
- Definition Classes
- Growable
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clear(): Unit
Clears the contents of this builder.
Clears the contents of this builder. After execution of this method, the builder will contain no elements.
If executed immediately after a call to
result, this allows a new instance of the same type of collection to be built.- Definition Classes
- ImmutableBuilder → ReusableBuilder → Builder → Growable
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
var
elems: C
- Attributes
- protected
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
mapResult[NewTo](f: (C) ⇒ NewTo): Builder[A, NewTo]
A builder resulting from this builder my mapping the result using
f.A builder resulting from this builder my mapping the result using
f.- Definition Classes
- Builder
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
result(): C
Produces a collection from the added elements.
Produces a collection from the added elements.
After a call to
result, the behavior of all other methods is undefined save forclear. Ifclearis called, then the builder is reset and may be used to build another instance.- returns
a collection containing the elements added to this builder.
- Definition Classes
- ImmutableBuilder → ReusableBuilder → Builder
-
final
def
sizeHint(coll: collection.Iterable[_], delta: Int): Unit
Gives a hint that one expects the
resultof this builder to have the same size as the given collection, plus some delta.Gives a hint that one expects the
resultof this builder to have the same size as the given collection, plus some delta. This will provide a hint only if the collection has a known size 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.- coll
the collection which serves as a hint for the result's size.
- delta
a correction to add to the
coll.sizeto produce the size hint.
- Definition Classes
- Builder
-
def
sizeHint(size: Int): Unit
Gives a hint how many elements are expected to be added when the next
resultis called.Gives a hint how many elements are expected to be added when the next
resultis 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.- size
the hint how many elements will be added.
- Definition Classes
- Builder
-
final
def
sizeHintBounded(size: Int, boundingColl: collection.Iterable[_]): Unit
Gives a hint how many elements are expected to be added when the next
resultis 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
resultis 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.- size
the hint how many elements will be added.
- boundingColl
the bounding collection. If it is an IndexedSeqLike, then sizes larger than collection's size are reduced.
- Definition Classes
- Builder
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )