Builds a collection of type C[A] element by element through a mutable builder: the construction half of a Binding.Seq. A codec decodes a sequence by calling newBuilder, one of the add methods for each element, and then result.
The companion object has an instance for each standard collection. The array-backed ones (arraySeqConstructor, arrayConstructor and, on Scala 3 only, iArrayConstructor) store the elements in an array of the element type, so addInt and the other primitive adders write a primitive element without boxing it.
def newBuilder[A](sizeHint: Int = ...)(implicit ct: ClassTag[A]): Builder[A]
Creates an empty builder. sizeHint is the expected number of elements: the array-backed constructors use it as the initial capacity (at least 1), chunkConstructor passes it to its builder, and the others ignore it. Only the array-backed constructors use ct, to create arrays of the element type.
Creates an empty builder. sizeHint is the expected number of elements: the array-backed constructors use it as the initial capacity (at least 1), chunkConstructor passes it to its builder, and the others ignore it. Only the array-backed constructors use ct, to create arrays of the element type.
Adds the Booleana to builder. This and the other primitive adders (addByte, addShort, addInt, addLong, addFloat, addDouble and addChar) call add by default, which boxes the value. The array-backed constructors override them to write into a primitive array without boxing, and chunkConstructor overrides all eight to forward the value to ChunkBuilder.addOne.
Adds the Booleana to builder. This and the other primitive adders (addByte, addShort, addInt, addLong, addFloat, addDouble and addChar) call add by default, which boxes the value. The array-backed constructors override them to write into a primitive array without boxing, and chunkConstructor overrides all eight to forward the value to ChunkBuilder.addOne.