Growable

trait Growable[-A] extends Clearable

This trait forms part of collections that can be augmented using a += operator and that can be cleared of all elements using a clear method.

Companion:
object
Source:
Growable.scala
trait Clearable
class Object
trait Matchable
class Any
trait Buffer[A]
class ArrayBuffer[A]
class ArrayDeque[A]
class Queue[A]
class Stack[A]
class ListBuffer[A]
trait Builder[A, To]
class Builder[K, V]
trait MapOps[K, V, CC, C]
class TrieMap[K, V]
class AnyRefMap[K, V]
class HashMap[K, V]
class LinkedHashMap[K, V]
class ListMap[K, V]
class LongMap[V]
trait Map[K, V]
trait Map[K, V]
class AbstractMap[K, V]
class WithDefault[K, V]
class WithDefault[K, V]
class TreeMap[K, V]
trait MultiMap[K, V]
trait SeqMap[K, V]
trait SortedMap[K, V]
trait SortedMapOps[K, V, CC, C]
class ofBoolean
class ofByte
class ofChar
class ofDouble
class ofFloat
class ofInt
class ofLong
class ofRef[T]
class ofShort
class ofUnit
trait SetOps[A, CC, C]
class HashSet[A]
trait Set[A]
class AbstractSet[A]
class BitSet
class TreeSet[A]
trait SortedSet[A]
trait SortedSetOps[A, CC, C]
class Accumulator[A, CC, C]

Value members

Abstract methods

def addOne(elem: A): Growable[A]

Adds a single element to this growable collection.

Adds a single element to this growable collection.

Value parameters:
elem

the element to add.

Returns:

the growable collection itself

Source:
Growable.scala

Concrete methods

final def ++=(xs: IterableOnce[A]): Growable[A]

Alias for addAll

Alias for addAll

Source:
Growable.scala
final def +=(elem: A): Growable[A]

Alias for addOne

Alias for addOne

Source:
Growable.scala

Adds all elements produced by an IterableOnce to this growable collection.

Adds all elements produced by an IterableOnce to this growable collection.

Value parameters:
xs

the IterableOnce producing the elements to add.

Returns:

the growable collection itself.

Source:
Growable.scala
Returns:

The number of elements in the collection under construction, if it can be cheaply computed, -1 otherwise. The default implementation always returns -1.

Source:
Growable.scala

Deprecated methods

@deprecated("Use `++=` aka `addAll` instead of varargs `+=`; infix operations with an operand of multiple args will be deprecated", "2.13.0") @inline
final def +=(elem1: A, elem2: A, elems: A*): Growable[A]

Adds two or more elements to this growable collection.

Adds two or more elements to this growable collection.

Value parameters:
elem1

the first element to add.

elem2

the second element to add.

elems

the remaining elements to add.

Returns:

the growable collection itself

Deprecated
Source:
Growable.scala

Inherited methods

def clear(): Unit

Clears the collection's contents.

Clears the collection's contents. After this operation, the collection is empty.

Inherited from:
Clearable
Source:
Growable.scala