scala.collection.mutable

class ArrayBuffer

[source: scala/collection/mutable/ArrayBuffer.scala]

@serializable

class ArrayBuffer[A]
extends Mutable[A] with Buffer[A] with ResizableArray[A]
An implementation of the Buffer class using an array to represent the assembled sequence internally.
Author
Matthias Zenger
Version
1.0, 15/03/2004
Direct Known Subclasses:
Script, NodeBuffer

Values and Variables inherited from ResizableArray
initialSize, array
Method Summary
override def ++ [B >: A](that : Iterable[B]) : ArrayBuffer[B]
Appends two iterable objects.
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.
override def ++= (src : Array[A], start : Int, len : Int) : Unit
Appends a number of elements in an array
override def ++= (iter : Iterable[A]) : Unit
Appends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
def +: (elem : A) : Buffer[A]
Prepends a single element to this buffer and return the identity of the buffer.
def += (elem : A) : Unit
Appends a single element to this buffer and returns the identity of the buffer.
override def apply (i : Int) : A
Returns the i-th element of this ArrayBuffer.
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. 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 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 ResizableArray
size0, size0_=, length, reduceToSize, copyToArray, copyToBuffer, elements, ensureSize, swap, copy
Methods inherited from Buffer
+, ++=, ++, ++, -=, append, appendAll, prepend, prependAll, insert, trimStart, trimEnd, <<, hashCode
Methods inherited from Mutable
projection, readOnly, drop, take, slice, reverse
Methods inherited from RandomAccessSeq
toStream, safeIs
Methods inherited from Seq
size, isEmpty, concat, last, lastOption, headOption, isDefinedAt, lastIndexOf, map, flatMap, filter, takeWhile, dropWhile, contains, subseq, toArray, equalsWith, startsWith, endsWith, indexOf, containsSlice
Methods inherited from Collection
toString
Methods inherited from Iterable
foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, sameElements, toList, mkString, mkString, mkString, addString, addString, hasDefiniteSize
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from AnyRef
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf