in scala.collection.mutable
class ListBuffer

`final class` ListBuffer [A]
  `extends` java.lang.Object
  `with` scala.collection.mutable.Buffer[A]
  `with` scala.ScalaObject

  The class `ListBuffer` ..

Author:
  Matthias Zenger
Version:
  1.0, 15/03/2004

Constructor Summary
| `def` this

Def Summary
| `def` +: (x: A) : scala.collection.mutable.Buffer[A] Prepends a single element to this buffer.
`override` | `def` += (x: A) : scala.Unit Appends a single element to this buffer.
| `def` - (x: A) : scala.collection.mutable.Buffer[A] Removes a single element from the buffer and return the identity of the buffer. Same as `this -= x; this`
`override` | `def` -= (x: A) : scala.Unit Remove a single element from this buffer.
| `def` apply (n: scala.Int) : A Returns the n-th element of this list. This method yields an error if the element does not exist.
| `def` clear : scala.Unit Clears the buffer contents.
`override` | `def` clone : scala.collection.mutable.Buffer[A] Returns a clone of this buffer.
`override` | `def` elements : java.lang.Object with scala.Iterator[A] Returns an iterator over all elements of this list. Note: the iterator can be affected by insertions, updates and deletions that are performed afterwards on the buffer. To get iterator an over the current buffer snapshot, use `toList.elements`.
`override` | `def` equals (obj: scala.Any) : scala.Boolean Checks if two buffers are structurally identical.
| `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 new one. Instead, it will insert a new element at index `n`.
| `def` length : scala.Int Returns the length of this buffer.
| `def` prependToList (xs: scala.List[A]) : scala.List[A] Prepends the elements of this buffer to a given list
| `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.
`override` | `def` toList : scala.List[A] Converts this buffer to a list
| `def` update (n: scala.Int, x: A) : scala.Unit Replaces element at index `n` with the new element `newelem`.

Def inherited from scala.collection.mutable.Buffer[A]
+ , ++, ++, ++:, ++=, ++=, ++=, +:, +=, -=, <<, append, appendAll, clear, clone, hashCode, insert, insertAll, prepend, prependAll, remove, stringPrefix, super$clone, trimEnd, trimStart, update

Constructor Detail

`def` this

Def Detail

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

  Prepends a single element to this buffer.

Parameters:
  `x -` the element to prepend.
Returns:
  this buffer.

`override def` += (x: A): scala.Unit

  Appends a single element to this buffer.

Parameters:
  `x -` the element to append.

`def` - (x: A): scala.collection.mutable.Buffer[A]

  Removes a single element from the buffer and return the identity of the buffer. Same as `this -= x; this`

Parameters:
  `x -` the element to remove.
Returns:
  this buffer.

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

  Remove a single element from this buffer.

Parameters:
  `x -` the element to remove.

`def` apply (n: scala.Int): A

  Returns the n-th element of this list. This method yields an error if the element does not exist.

Parameters:
  `n -` the position of the element to be returned.
Returns:
  the n-th element of this buffer.
Throws:
  `Predef.IndexOutOfBoundsException -`

`def` clear : scala.Unit

  Clears the buffer contents.

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

  Returns a clone of this buffer.

Returns:
  a `ListBuffer` with the same elements.

`override def` elements : java.lang.Object with scala.Iterator[A]

  Returns an iterator over all elements of this list.

  > Note: the iterator can be affected by insertions, updates and deletions that are performed afterwards on the buffer. To get iterator an over the current buffer snapshot, use `toList.elements`.

Throws:
  `Predef.NoSuchElementException -` if buffer is empty

`override def` equals (obj: scala.Any): scala.Boolean

  Checks if two buffers are structurally identical.

Returns:
  `true`, iff both buffers contain the same sequence of elements.

`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 new 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.
Throws:
  `Predef.IndexOutOfBoundsException -` if `n` is out of bounds.

`def` length : scala.Int

  Returns the length of this buffer.

Returns:
  the length of this buffer.

`def` prependToList (xs: scala.List[A]): scala.List[A]

  Prepends the elements of this buffer to a given list

Parameters:
  `xs -` the list to which elements are prepended

`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.
Returns:
  n the element that was formerly at position `n`.
Precondition:
  an element exists at position `n`
Throws:
  `Predef.IndexOutOfBoundsException -` if `n` is out of bounds.

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

  Defines the prefix of the string representation.

Returns:
  the string representation of this buffer.

`override def` toList : scala.List[A]

  Converts this buffer to a list

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

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

Parameters:
  `n -` the index of the element to replace.
Parameters:
  `x -` the new element.
Throws:
  `Predef.IndexOutOfBoundsException -` if `n` is out of bounds.