class ArrayBuffer[A] extends IndexedOptimizedGrowableSeq[A] with SeqLike[A, ArrayBuffer] with Buildable[A, ArrayBuffer[A]] with Builder[A, ArrayBuffer[A]]
Concrete collection type: ArrayBuffer
- Alphabetic
- By Inheritance
- ArrayBuffer
- Builder
- Buildable
- IndexedOptimizedGrowableSeq
- GrowableSeq
- Growable
- IndexedOptimizedSeq
- Seq
- Iterable
- Seq
- ArrayLike
- SeqLike
- Equals
- SeqMonoTransforms
- Iterable
- IterableLike
- IterablePolyTransforms
- IterableMonoTransforms
- IterableOps
- FromIterable
- IterableOnce
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ArrayBuffer()
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
++[B >: A](xs: IterableOnce[B]): ArrayBuffer[B]
Concatenation
Concatenation
- Definition Classes
- IterablePolyTransforms
-
def
++=(elems: IterableOnce[A]): ArrayBuffer.this.type
Overridden to use array copying for efficiency where possible.
Overridden to use array copying for efficiency where possible.
- returns
the $coll itself.
- Definition Classes
- ArrayBuffer → Growable
-
def
+=(elem: A): ArrayBuffer.this.type
Append an element
-
def
+=(elem1: A, elem2: A, elems: A*): ArrayBuffer.this.type
${Add}s two or more elements to this $coll.
${Add}s two or more elements to this $coll.
- elem1
the first element to $add.
- elem2
the second element to $add.
- elems
the remaining elements to $add.
- returns
the $coll itself
- Definition Classes
- Growable
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
apply(n: Int): A
- Definition Classes
- ArrayBuffer → ArrayLike
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
canEqual(that: Any): Boolean
Method called from equality methods, so that user-defined subclasses can refuse to be equal to other collections of the same kind.
Method called from equality methods, so that user-defined subclasses can refuse to be equal to other collections of the same kind.
- that
The object with which this $coll should be compared
- returns
true, if this $coll can possibly equalthat,falseotherwise. The test takes into consideration only the run-time types of objects but ignores their elements.
- Definition Classes
- SeqLike → Equals
-
def
className: String
The class name of this collection.
The class name of this collection. To be used for converting to string. Collections generally print like this:
<className>(elem_1, ..., elem_n)
- Definition Classes
- ArrayBuffer → IterableOps
-
def
clear(): Unit
Clears the contents of this builder.
Clears the contents of this builder. After execution of this method the builder will contain no elements.
- Definition Classes
- ArrayBuffer → Builder → Growable
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
coll: ArrayBuffer.this.type
The collection itself
The collection itself
- Attributes
- protected
- Definition Classes
- Iterable → IterablePolyTransforms → IterableMonoTransforms → IterableOps
-
def
copyToArray[B >: A](xs: Array[B], start: Int = 0): xs.type
Copy all elements of this collection to array
xs, starting atstart.Copy all elements of this collection to array
xs, starting atstart.- Definition Classes
- IterableOps
-
def
drop(n: Int): ArrayBuffer[A @scala.annotation.unchecked.uncheckedVariance]
The rest of the collection without its
nfirst elements.The rest of the collection without its
nfirst elements. For linear, immutable collections this should avoid making a copy.- Definition Classes
- IterableMonoTransforms
-
def
dropInPlace(n: Int): ArrayBuffer.this.type
- Definition Classes
- GrowableSeq
-
def
dropRightInPlace(n: Int): ArrayBuffer.this.type
- Definition Classes
- GrowableSeq
-
def
dropWhileInPlace(p: (A) ⇒ Boolean): ArrayBuffer.this.type
- Definition Classes
- GrowableSeq
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(o: Any): Boolean
- Definition Classes
- SeqLike → Equals → AnyRef → Any
-
def
filter(p: (A) ⇒ Boolean): ArrayBuffer[A @scala.annotation.unchecked.uncheckedVariance]
All elements satisfying predicate
pAll elements satisfying predicate
p- Definition Classes
- IterableMonoTransforms
-
def
filterInPlace(p: (A) ⇒ Boolean): ArrayBuffer.this.type
- Definition Classes
- IndexedOptimizedGrowableSeq → GrowableSeq
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
flatMap[B](f: (A) ⇒ IterableOnce[B]): ArrayBuffer[B]
Flatmap
Flatmap
- Definition Classes
- IterablePolyTransforms
-
def
flatMapInPlace(f: (A) ⇒ IterableOnce[A]): ArrayBuffer.this.type
- Definition Classes
- IndexedOptimizedGrowableSeq → GrowableSeq
-
def
foldLeft[B](z: B)(op: (B, A) ⇒ B): B
Fold left
Fold left
- Definition Classes
- IterableOps
-
def
foldRight[B](z: B)(op: (A, B) ⇒ B): B
Fold right
Fold right
- Definition Classes
- IterableOps
-
def
foreach[U](f: (A) ⇒ U): Unit
Apply
fto each element for its side effects Note: [U] parameter needed to help scalac's type inference.Apply
fto each element for its side effects Note: [U] parameter needed to help scalac's type inference.- Definition Classes
- IterableOps
-
def
fromIterable[B](it: collection.Iterable[B]): ArrayBuffer[B]
- Definition Classes
- ArrayBuffer → IterablePolyTransforms → FromIterable
-
def
fromIterableWithSameElemType(coll: collection.Iterable[A]): ArrayBuffer[A]
Create a collection of type
C[A]from the elements ofcoll, which has the same element type as this collection.Create a collection of type
C[A]from the elements ofcoll, which has the same element type as this collection. Overridden in StringOps and ArrayOps.- Attributes
- protected[this]
- Definition Classes
- SeqLike → IterableLike → IterableMonoTransforms
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- SeqLike → AnyRef → Any
-
def
head: A
The first element of the collection.
The first element of the collection.
- Definition Classes
- IterableOps
-
def
indexWhere(p: (A) ⇒ Boolean): Int
The index of the first element in this collection for which
pholds.The index of the first element in this collection for which
pholds.- Definition Classes
- IterableOps
-
def
insert(idx: Int, elem: A): Unit
- Definition Classes
- ArrayBuffer → GrowableSeq
-
def
insertAll(idx: Int, elems: IterableOnce[A]): Unit
- Definition Classes
- ArrayBuffer → GrowableSeq
-
def
isEmpty: Boolean
Is the collection empty?
Is the collection empty?
- Definition Classes
- IterableOps
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
iterator(): Iterator[Nothing]
Iterator can be used only once
Iterator can be used only once
- Definition Classes
- ArrayBuffer → IterableOnce
-
def
knownSize: Int
The number of elements in this collection, if it can be cheaply computed, -1 otherwise.
The number of elements in this collection, if it can be cheaply computed, -1 otherwise. Cheaply usually means: Not requiring a collection traversal.
- Definition Classes
- ArrayBuffer → IterableOps
-
def
length: Int
- Definition Classes
- ArrayBuffer → ArrayLike
-
def
map[B](f: (A) ⇒ B): ArrayBuffer[B]
Map
Map
- Definition Classes
- IterablePolyTransforms
-
def
mapInPlace(f: (A) ⇒ A): ArrayBuffer.this.type
- Definition Classes
- IndexedOptimizedSeq → Seq
-
def
mapResult[NewTo](f: (ArrayBuffer[A]) ⇒ NewTo): Builder[A, NewTo]
A builder resulting from this builder my mapping the result using
f.A builder resulting from this builder my mapping the result using
f.- Definition Classes
- Builder
-
def
mkString(sep: String): String
A string showing all elements of this collection, separated by string
sep.A string showing all elements of this collection, separated by string
sep.- Definition Classes
- IterableOps
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newBuilder: ArrayBuffer[A]
Creates a new builder.
Creates a new builder.
- Attributes
- protected[this]
- Definition Classes
- ArrayBuffer → Buildable
-
def
nonEmpty: Boolean
Is the collection not empty?
Is the collection not empty?
- Definition Classes
- IterableOps
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
padToInPlace(len: Int, elem: A): ArrayBuffer.this.type
- Definition Classes
- GrowableSeq
-
def
partition(p: (A) ⇒ Boolean): (ArrayBuffer[A], ArrayBuffer[A])
Optimized, push-based version of
partition.Optimized, push-based version of
partition.- Definition Classes
- Buildable → IterableMonoTransforms
-
def
patchInPlace(from: Int, patch: collection.Seq[A], replaced: Int): ArrayBuffer.this.type
- Definition Classes
- IndexedOptimizedGrowableSeq → GrowableSeq
-
def
remove(from: Int, n: Int): Unit
- Definition Classes
- ArrayBuffer → GrowableSeq
-
def
remove(idx: Int): A
- Definition Classes
- ArrayBuffer → GrowableSeq
-
def
result: ArrayBuffer[A]
Result collection consisting of all elements appended so far.
Result collection consisting of all elements appended so far.
- Definition Classes
- ArrayBuffer → Builder
-
def
reverse: ArrayBuffer[A @scala.annotation.unchecked.uncheckedVariance]
- Definition Classes
- SeqMonoTransforms
-
def
sameElements[B >: A](that: IterableOnce[B]): Boolean
Do the elements of this collection are the same (and in the same order) as those of
that?Do the elements of this collection are the same (and in the same order) as those of
that?- Definition Classes
- SeqLike
-
def
size: Int
The number of elements in this collection.
The number of elements in this collection. Does not terminate for infinite collections.
- Definition Classes
- IterableOps
-
def
sliceInPlace(start: Int, end: Int): ArrayBuffer.this.type
- Definition Classes
- GrowableSeq
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
tail: ArrayBuffer[A @scala.annotation.unchecked.uncheckedVariance]
The rest of the collection without its first element.
The rest of the collection without its first element.
- Definition Classes
- IterableMonoTransforms
-
def
take(n: Int): ArrayBuffer[A @scala.annotation.unchecked.uncheckedVariance]
A collection containing the first
nelements of this collection.A collection containing the first
nelements of this collection.- Definition Classes
- IterableMonoTransforms
-
def
takeInPlace(n: Int): ArrayBuffer.this.type
- Definition Classes
- GrowableSeq
-
def
takeRightInPlace(n: Int): ArrayBuffer.this.type
- Definition Classes
- GrowableSeq
-
def
takeWhileInPlace(p: (A) ⇒ Boolean): ArrayBuffer.this.type
- Definition Classes
- GrowableSeq
-
def
to[C[X] <: collection.Iterable[X]](fi: FromIterable[C]): C[A]
Given a collection factory
fifor collections of type constructorC, convert this collection to one of typeC[A].Given a collection factory
fifor collections of type constructorC, convert this collection to one of typeC[A]. Example uses:xs.to(List) xs.to(ArrayBuffer)
- Definition Classes
- IterableOps
-
def
toArray[B >: A](implicit arg0: ClassTag[B]): Array[B]
Convert collection to array.
Convert collection to array.
- Definition Classes
- IterableOps
-
def
toString(): String
- Definition Classes
- IterableOps → Any
-
def
update(n: Int, elem: A): Unit
- Definition Classes
- ArrayBuffer → Seq
-
def
view: ArrayBufferView[Nothing]
A view representing the elements of this collection.
A view representing the elements of this collection.
- Definition Classes
- ArrayBuffer → IterableOps
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
zip[B](xs: IterableOnce[B]): ArrayBuffer[(A, B)]
Zip.
Zip. Interesting because it requires to align to source collections.
- Definition Classes
- IterablePolyTransforms