in scala/collection/mutable
class ArrayBuffer

class ArrayBuffer[A]()
extends Buffer[A]
with ScalaObject
with ResizableArray[A]
Implementing classes or objects:
class Script[A]()
class NodeBuffer() in scala/xml

An implementation of the Buffer trait using an array to represent the assembled sequence internally.
Author:
Matthias Zenger
Version:
1.0, 15/03/2004

Method Summary
  def +(elem: A): Buffer[A]
     Append a single element to this buffer and return the identity of the buffer.
override def ++(iter: Iterable[A]): Buffer[A]
     Appends a number of elements provided by an iterable object via its elements method.
  def ++(iter: Iterator[A]): Buffer[A]
     Appends a number of elements provided by an iterable object via its elements method.
override def ++:(iter: Iterable[A]): Buffer[A]
     Prepends a number of elements provided by an iterable object via its elements method.
  def +:(elem: A): Buffer[A]
     Prepend a single element to this buffer and return the identity of the buffer.
  def apply(n: Int): A
  def clear: Unit
     Clears the buffer contents.
override def clone(): Buffer[A]
     Return a clone of this buffer.
override def equals(obj: Any): Boolean
     Checks if two buffers are structurally identical.
  def insertAll(n: Int, iter: Iterable[A]): Unit
     Inserts new elements at the index n.
  def remove(n: Int): A
     Removes the element on a given index position.
protected override def stringPrefix: String
     Defines the prefix of the string representation.
  def update(n: Int, newelem: A): Unit
     Replace element at index n with the new element newelem.

Methods inherited from java/lang/Object-class
eq, finalize, getClass, ne, notify, notifyAll, synchronized, wait, wait, wait

Methods inherited from scala/Any-class
!=, ==, asInstanceOf, isInstanceOf, match

Methods inherited from scala/Iterable-class
/:, :\, concat, exists, find, foldLeft, foldRight, forall, foreach, sameElements

Methods inherited from scala/ScalaObject-class
getScalaType

Methods inherited from scala/Seq-class
concat, copyToArray, drop, indexOf, isDefinedAt, lastIndexOf, subseq, take, toList, toString

Methods inherited from scala/collection/mutable/Buffer-class
++, ++=, ++=, +=, <<, append, appendAll, hashCode, insert, prepend, prependAll, trimEnd, trimStart

Methods inherited from scala/collection/mutable/ResizableArray-class
array, copy, elements, ensureSize, initialSize, length, size, swap

Method Detail

apply

  def apply(n: Int): A

+

  def +(elem: A): Buffer[A]
Append a single element to this buffer and return the identity of the buffer.
Parameters:
elem - the element to append.

++

  override def ++(iter: Iterable[A]): 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.

++

  def ++(iter: Iterator[A]): 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.

+:

  def +:(elem: A): Buffer[A]
Prepend a single element to this buffer and return the identity of the buffer.
Parameters:
elem - the element to append.

++:

  override def ++:(iter: Iterable[A]): 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.

insertAll

  def insertAll(n: Int, iter: Iterable[A]): 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.
iter - the iterable object providing all elements to insert.

update

  def update(n: Int, newelem: A): Unit
Replace element at index n with the new element newelem.
Parameters:
n - the index of the element to replace.
newelem - the new element.

remove

  def remove(n: Int): A
Removes the element on a given index position.
Parameters:
n - the index which refers to the element to delete.

clear

  def clear: Unit
Clears the buffer contents.

clone

  override def clone(): Buffer[A]
Return a clone of this buffer.
Returns:
an ArrayBuffer with the same elements.

equals

  override def equals(obj: Any): Boolean
Checks if two buffers are structurally identical.
Returns:
true, iff both buffers contain the same sequence of elements.

stringPrefix

  protected override def stringPrefix: String
Defines the prefix of the string representation.