in scala.collection.mutable
trait Buffer

[scala.cloneable]
`abstract trait` Buffer [A]
  `extends` java.lang.Object
  `with` scala.Seq[A]
  `with` scala.collection.mutable.Scriptable[scala.collection.mutable.Message[scala.Tuple2[scala.collection.mutable.Location, A]]]
  `with` scala.ScalaObject

  Buffers are used to create sequences of elements incrementally by appending, prepending, or inserting new elements. It is also possible to access and modify elements in a random access fashion via the index of the element in the current sequence.

Author:
  Matthias Zenger
Version:
  1.1, 02/03/2004

Direct Known Subclasses:
  SynchronizedBuffer, ObservableBuffer, ListBuffer, BufferProxy, ArrayBuffer

Def Summary
| `def` + (elem: A) : scala.collection.mutable.Buffer[A] Append a single element to this buffer and return the identity of the buffer.
| `def` ++ (elems: scala.Iterable[A]) : scala.collection.mutable.Buffer[A] Appends a number of elements provided by an iterable object via its `elements` method. The identity of the buffer is returned.
| `def` ++ (iter: scala.Iterator[A]) : scala.collection.mutable.Buffer[A] Appends a number of elements provided by an iterable object via its `elements` method. The identity of the buffer is returned.
| `def` ++: (iter: scala.Iterable[A]) : scala.collection.mutable.Buffer[A] Prepends a number of elements provided by an iterable object via its `elements` method. The identity of the buffer is returned.
| `def` ++= (elems: scala.Iterable[A]) : scala.Unit Appends a number of elements provided by an iterable object via its `elements` method.
| `def` ++= (it: scala.Iterator[A]) : scala.Unit Appends a number of elements provided by an iterable object via its `elements` method.
`abstract` | `def` +: (elem: A) : scala.collection.mutable.Buffer[A] Prepend a single element to this buffer and return the identity of the buffer.
`abstract` | `def` += (elem: A) : scala.Unit Append a single element to this buffer.
| `def` -= (x: A) : scala.Unit Removes a single element from this buffer, at its first occurrence. If the list does not contain that element, it is unchanged
| `def` << (cmd: scala.collection.mutable.Message[scala.Tuple2[scala.collection.mutable.Location, A]]) : scala.Unit Send a message to this scriptable object.
| `def` append (elems: A*) : scala.Unit Appends a sequence of elements to this buffer.
| `def` appendAll (iter: scala.Iterable[A]) : scala.Unit Appends a number of elements provided by an iterable object via its `elements` method.
`abstract` | `def` clear : scala.Unit Clears the buffer contents.
`override` | `def` clone : scala.collection.mutable.Buffer[A] Return a clone of this buffer.
`override` | `def` hashCode : scala.Int The hashCode method always yields an error, since it is not safe to use buffers as keys in hash tables.
| `def` insert (n: scala.Int, elems: A*) : scala.Unit Inserts new elements at the index `n`. Opposed to method `update`, this method will not replace an element with a one. Instead, it will insert the new elements at index `n`.
`abstract` | `def` insertAll (n: scala.Int, iter: scala.Iterable[A]) : scala.Unit Inserts new elements at the index `n`. Opposed to method `update`, this method will not replace an element with a one. Instead, it will insert a new element at index `n`.
| `def` prepend (elems: A*) : scala.Unit Prepend an element to this list.
| `def` prependAll (elems: scala.Iterable[A]) : scala.Unit Prepends a number of elements provided by an iterable object via its `elements` method. The identity of the buffer is returned.
`abstract` | `def` remove (n: scala.Int) : A Removes the element on a given index position.
`override` `protected` | `def` stringPrefix : java.lang.String Defines the prefix of the string representation.
| `def` trimEnd (n: scala.Int) : scala.Unit Removes the last `n` elements.
| `def` trimStart (n: scala.Int) : scala.Unit Removes the first `n` elements.
`abstract` | `def` update (n: scala.Int, newelem: A) : scala.Unit Replace element at index `n` with the new element `newelem`.

Def Detail

`def` + (elem: A): scala.collection.mutable.Buffer[A]

  Append a single element to this buffer and return the identity of the buffer.

Parameters:
  `elem -` the element to append.

`def` ++ (elems: scala.Iterable[A]): scala.collection.mutable.Buffer[A]

  Appends a number of elements provided by an iterable object via its `elements` method. The identity of the buffer is returned.

Parameters:
  `iter -` the iterable object.
Returns:
  the updated buffer.

`def` ++ (iter: scala.Iterator[A]): scala.collection.mutable.Buffer[A]

  Appends a number of elements provided by an iterable object via its `elements` method. The identity of the buffer is returned.

Parameters:
  `iter -` the iterable object.
Returns:
  the updated buffer.

`def` ++: (iter: scala.Iterable[A]): scala.collection.mutable.Buffer[A]

  Prepends a number of elements provided by an iterable object via its `elements` method. The identity of the buffer is returned.

Parameters:
  `iter -` the iterable object.

`def` ++= (elems: scala.Iterable[A]): scala.Unit

  Appends a number of elements provided by an iterable object via its `elements` method.

Parameters:
  `iter -` the iterable object.

`def` ++= (it: scala.Iterator[A]): scala.Unit

  Appends a number of elements provided by an iterable object via its `elements` method.

Parameters:
  `iter -` the iterable object.

`abstract def` +: (elem: A): scala.collection.mutable.Buffer[A]

  Prepend a single element to this buffer and return the identity of the buffer.

Parameters:
  `elem -` the element to append.

`abstract def` += (elem: A): scala.Unit

  Append a single element to this buffer.

Parameters:
  `elem -` the element to append.

`def` -= (x: A): scala.Unit

  Removes a single element from this buffer, at its first occurrence. If the list does not contain that element, it is unchanged

Parameters:
  `x -` the element to remove.

`def` << (cmd: scala.collection.mutable.Message[scala.Tuple2[scala.collection.mutable.Location, A]]): scala.Unit

  Send a message to this scriptable object.

Parameters:
  `cmd -` the message to send.

`def` append (elems: A*): scala.Unit

  Appends a sequence of elements to this buffer.

Parameters:
  `elems -` the elements to append.

`def` appendAll (iter: scala.Iterable[A]): scala.Unit

  Appends a number of elements provided by an iterable object via its `elements` method.

Parameters:
  `iter -` the iterable object.

`abstract def` clear : scala.Unit

  Clears the buffer contents.

`override def` clone : scala.collection.mutable.Buffer[A]

  Return a clone of this buffer.

Returns:
  a buffer with the same elements.

`override def` hashCode : scala.Int

  The hashCode method always yields an error, since it is not safe to use buffers as keys in hash tables.

Returns:
  never.

`def` insert (n: scala.Int, elems: A*): scala.Unit

  Inserts new elements at the index `n`. Opposed to method `update`, this method will not replace an element with a one. Instead, it will insert the new elements at index `n`.

Parameters:
  `n -` the index where a new element will be inserted.
Parameters:
  `elems -` the new elements to insert.

`abstract def` insertAll (n: scala.Int, iter: scala.Iterable[A]): scala.Unit

  Inserts new elements at the index `n`. Opposed to method `update`, this method will not replace an element with a one. Instead, it will insert a new element at index `n`.

Parameters:
  `n -` the index where a new element will be inserted.
Parameters:
  `iter -` the iterable object providing all elements to insert.

`def` prepend (elems: A*): scala.Unit

  Prepend an element to this list.

Parameters:
  `elem -` the element to prepend.

`def` prependAll (elems: scala.Iterable[A]): scala.Unit

  Prepends a number of elements provided by an iterable object via its `elements` method. The identity of the buffer is returned.

Parameters:
  `iter -` the iterable object.

`abstract def` remove (n: scala.Int): A

  Removes the element on a given index position.

Parameters:
  `n -` the index which refers to the element to delete.

`override protected def` stringPrefix : java.lang.String

  Defines the prefix of the string representation.

`def` trimEnd (n: scala.Int): scala.Unit

  Removes the last `n` elements.

Parameters:
  `n -` the number of elements to remove from the end of this buffer.

`def` trimStart (n: scala.Int): scala.Unit

  Removes the first `n` elements.

Parameters:
  `n -` the number of elements to remove from the beginning of this buffer.

`abstract def` update (n: scala.Int, newelem: A): scala.Unit

  Replace element at index `n` with the new element `newelem`.

Parameters:
  `n -` the index of the element to replace.
Parameters:
  `newelem -` the new element.