Scala Library Documentation
|
|
class
ArrayBuffer[A]
extends
Mutable[A] with
Buffer[A] with
ResizableArray[A]Buffer
class using an array to
represent the assembled sequence internally.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
|
++=
(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. |
override def
|
++=
(src : Array[A], start : Int, len : Int) : Unit
Appends a number of elements in an array
|
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
: java.lang.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 | |
patch, toStream, safeIs |
Methods inherited from Seq | |
lengthCompare, 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 | |
partition, 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 |
Method Details |
elem -
the element to append.elements
method. The identity of the
buffer is returned.iter -
the iterable object.override
def
++[B >: A](that : Iterable[B]) : ArrayBuffer[B]
src -
the arraystart -
the first element to appendlen -
the number of elements to appendelem -
the element to append.i -
the specified index.Predef.IndexOutOfBoundException -
if i
is out of bounds.elements
method. The identity of the
buffer is returned.iter -
the iterable object.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
.n -
the index where a new element will be inserted.iter -
the iterable object providing all elements to insert.n
is out of bounds.n
with the new element
newelem
.n -
the index of the element to replace.newelem -
the new element.n
is out of bounds.n -
the index which refers to the element to delete.n
is out of bounds.
def
clear : Unit
ArrayBuffer
with the same elements.protected override
def
stringPrefix : java.lang.String
Scala Library Documentation
|
|