trait ArrayBufferLike[T] extends Buffer[T]
Common buffer functions impl for array-backend buffers.
- Alphabetic
- By Inheritance
- ArrayBufferLike
- Buffer
- Function1
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def apply(index: Int): T
Returns value at the provided index.
Returns value at the provided index.
- Definition Classes
- Buffer → Function1
- abstract def asArray: Array[T]
Returns a trimmed copy of an underlying array.
Returns a trimmed copy of an underlying array.
- Definition Classes
- Buffer
- abstract def asSlice: Slice[T]
Wraps accessible internal state as a Slice without making any copy.
Wraps accessible internal state as a Slice without making any copy.
- Definition Classes
- Buffer
- abstract def copy: ArrayBufferLike.this.type
Creates a copy of this buffer.
Creates a copy of this buffer.
- Definition Classes
- Buffer
- abstract def copyFrom(slice: Slice[T], targetIndex: Int): Unit
- Attributes
- protected
- abstract def copyFrom(sourceArray: Array[T], sourceIndex: Int, targetIndex: Int, copyLength: Int): Unit
- Attributes
- protected
- abstract def copyFromSelf(sourceIndex: Int, targetIndex: Int, copyLength: Int): Unit
- Attributes
- protected
- abstract def emptyArray(length: Int): Array[T]
- Attributes
- protected
- abstract def emptyCopy: ArrayBufferLike.this.type
Creates a copy of this buffer.
Creates a copy of this buffer.
- Definition Classes
- Buffer
- abstract def ensureIndex(index: Int): Unit
Ensures buffer capacity to address provided index.
Ensures buffer capacity to address provided index.
- Attributes
- protected
- Definition Classes
- Buffer
- abstract def read(index: Int): T
Returns value at the given index without checks.
Returns value at the given index without checks.
- Attributes
- protected
- Definition Classes
- Buffer
- abstract def slice(from: Int, to: Int): Slice[T]
Takes range and returns a Slice.
Takes range and returns a Slice.
- Definition Classes
- Buffer
- abstract def toArray[T1 >: T](implicit arg0: ClassTag[T1]): Array[T1]
Returns a trimmed copy of an underlying array.
Returns a trimmed copy of an underlying array.
- Definition Classes
- Buffer
- abstract def write(index: Int, value: T): Unit
Stores value at the given index without checks.
Stores value at the given index without checks.
- Attributes
- protected
- Definition Classes
- Buffer
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def andThen[A](g: (T) => A): (Int) => A
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- final def append(value: T): ArrayBufferLike.this.type
Appends value at the end of the buffer and advances topIndex.
Appends value at the end of the buffer and advances topIndex.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def appendArray(values: Array[T]): ArrayBufferLike.this.type
Appends values from the given array at the end of the buffer and advances topIndex.
Appends values from the given array at the end of the buffer and advances topIndex.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def appendFromIterator(numberOfValues: Int, iterator: Iterator[T]): ArrayBufferLike.this.type
Appends number of values from the given iterator at the end of the buffer and advances topIndex.
Appends number of values from the given iterator at the end of the buffer and advances topIndex.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def appendFromIterator(iterator: Iterator[T]): ArrayBufferLike.this.type
Appends values from the given iterator at the end of the buffer and advances topIndex.
Appends values from the given iterator at the end of the buffer and advances topIndex.
- Definition Classes
- Buffer
- final def appendIterable(iterable: Iterable[T]): ArrayBufferLike.this.type
Appends values from the given iterable at the end of the buffer and advances topIndex.
Appends values from the given iterable at the end of the buffer and advances topIndex.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def appendSequence(values: IndexedSeq[T]): ArrayBufferLike.this.type
Appends values from the given sequence at the end of the buffer and advances topIndex.
Appends values from the given sequence at the end of the buffer and advances topIndex.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def appendSlice(slice: Slice[T]): ArrayBufferLike.this.type
Appends values from the given slice at the end of the buffer and advances topIndex.
Appends values from the given slice at the end of the buffer and advances topIndex.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compose[A](g: (A) => Int): (A) => T
- Definition Classes
- Function1
- Annotations
- @unspecialized()
- final def contains(value: T): Boolean
Returns true if buffer contains given value.
Returns true if buffer contains given value.
- Definition Classes
- Buffer
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def exists(pred: (T) => Boolean): Boolean
Returns true if buffer contains value fulfilling the predicate.
Returns true if buffer contains value fulfilling the predicate.
- Definition Classes
- Buffer
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def forward(distance: Int): ArrayBufferLike.this.type
Moves topIndex value right by the distance.
Moves topIndex value right by the distance.
- Definition Classes
- Buffer
- final def get(index: Int): Option[T]
Returns Some value at the index, or None if index outside of range.
Returns Some value at the index, or None if index outside of range.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def head: T
Returns value at the topIndex.
Returns value at the topIndex.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def headOption: Option[T]
Returns Some value at the topIndex or None if empty buffer.
Returns Some value at the topIndex or None if empty buffer.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def init: ArrayBufferLike.this.type
Returns this buffer without a first element.
Returns this buffer without a first element.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def insert(index: Int, value: T): ArrayBufferLike.this.type
Shifts content in [index, length) one step to the right and updates value at index.
Shifts content in [index, length) one step to the right and updates value at index.
- Definition Classes
- Buffer
- final def insertArray(index: Int, sourceIndex: Int, insertLength: Int, sourceArray: Array[T]): ArrayBufferLike.this.type
Shift current content to the right starting from
index
at theinsertLength
distance, and copies array chunk into the gap.Shift current content to the right starting from
index
at theinsertLength
distance, and copies array chunk into the gap. Sets topIndex to be at least at the end of the new chunk of values.- Definition Classes
- ArrayBufferLike → Buffer
- final def insertFromIterator(index: Int, numberOfValues: Int, iterator: Iterator[T]): ArrayBufferLike.this.type
Shift current content to the right starting from
index
at themin(iterator.length, insertLength)
distance, and inserts iterated values into the gap.Shift current content to the right starting from
index
at themin(iterator.length, insertLength)
distance, and inserts iterated values into the gap. - Sets topIndex to be at least at the end of the new chunk of values.- Definition Classes
- Buffer
- final def insertFromIterator(index: Int, iterator: Iterator[T]): ArrayBufferLike.this.type
Inserts iterated values into the gap made by shiftjng buffer right, starting from the index.
Inserts iterated values into the gap made by shiftjng buffer right, starting from the index. - Sets topIndex to be at least at the end of the new chunk of values.
- Definition Classes
- Buffer
- final def insertFromIteratorReverse(index: Int, numberOfValues: Int, iterator: Iterator[T]): ArrayBufferLike.this.type
Shift current content to the right starting from
index
at themin(iterator.length, insertLength)
distance, and inserts iterated values into the gap in the reverse order.Shift current content to the right starting from
index
at themin(iterator.length, insertLength)
distance, and inserts iterated values into the gap in the reverse order. - Sets topIndex to be at least at the end of the new chunk of values.- Definition Classes
- Buffer
- final def insertFromIteratorReverse(index: Int, iterator: Iterator[T]): ArrayBufferLike.this.type
Inserts iterated values, in the reverse order, into the gap made by shiftjng buffer right, starting from the index.
Inserts iterated values, in the reverse order, into the gap made by shiftjng buffer right, starting from the index. - Sets topIndex to be at least at the end of the new chunk of values.
- Definition Classes
- Buffer
- final def insertSlice(index: Int, slice: Slice[T]): ArrayBufferLike.this.type
Shift current content to the right starting from
index
at theslice.length
distance, and copies slice content into the gap.Shift current content to the right starting from
index
at theslice.length
distance, and copies slice content into the gap. Sets topIndex to be at least at the end of the new chunk of values.- Definition Classes
- ArrayBufferLike → Buffer
- final def insertValues(index: Int, sourceIndex: Int, numberOfValues: Int, source: (Int) => T): ArrayBufferLike.this.type
Shift current content to the right starting from
index
at theinsertLength
distance, iterates over the source indexes and copies values into the gap.Shift current content to the right starting from
index
at theinsertLength
distance, iterates over the source indexes and copies values into the gap. - Sets topIndex to be at least at the end of the new chunk of values.- Definition Classes
- Buffer
- final def isEmpty: Boolean
Is the accessible part of the buffer empty?
Is the accessible part of the buffer empty?
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def iterator: Iterator[T]
Returns an iterator over actual buffer values, starting from the zero index up.
Returns an iterator over actual buffer values, starting from the zero index up.
- Definition Classes
- Buffer
- Note
does not copy buffer values,
- final def last: T
Returns value at the zero index.
Returns value at the zero index.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def lastOption: Option[T]
Returns Some value at the zero index, or None if empty buffer.
Returns Some value at the zero index, or None if empty buffer.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def length: Int
Length of the accessible part of the buffer.
Length of the accessible part of the buffer.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def map[K](f: (T) => K): Iterable[K]
Iterable representing lazily mapped values of this buffer at the time of access.
Iterable representing lazily mapped values of this buffer at the time of access.
- f
map function
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def mapInPlace(f: (T) => T): ArrayBufferLike.this.type
Updates in-place all values in the range [0,length) using the function.
Updates in-place all values in the range [0,length) using the function.
- f
map function
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def modify(index: Int, map: (T) => T): ArrayBufferLike.this.type
Updates value at the provided index using the function.
Updates value at the provided index using the function. Index must fall within range [0,length).
- index
value's index
- map
map function
- Definition Classes
- Buffer
- Exceptions thrown
IndexOutOfBoundsException
if index lower than zero.
- final def modifyAll(map: (T) => T): ArrayBufferLike.this.type
Updates all values in the range [0,length) using the function.
Updates all values in the range [0,length) using the function.
- map
map function
- Definition Classes
- Buffer
- final def modifyAllWhen(map: (T) => T, pred: (T) => Boolean): ArrayBufferLike.this.type
Updates all accepted values in the range [0,length) using the function.
Updates all accepted values in the range [0,length) using the function.
- map
map function
- pred
filter function
- Definition Classes
- Buffer
- final def modifyRange(fromIndex: Int, toIndex: Int, map: (T) => T): ArrayBufferLike.this.type
Updates values in the range [startIndex,toIndex)^^[0,length) using the function. One of {startIndex,toIndex} must fall within range [0,length).
Updates values in the range [startIndex,toIndex)^^[0,length) using the function. One of {startIndex,toIndex} must fall within range [0,length).
- fromIndex
index of the first value inclusive
- toIndex
index of the last value exclusive
- map
map function
- Definition Classes
- Buffer
- Exceptions thrown
IndexOutOfBoundsException
if index lower than zero.
- final def modifyRangeWhen(fromIndex: Int, toIndex: Int, map: (T) => T, pred: (T) => Boolean): ArrayBufferLike.this.type
Updates values in the range [startIndex,toIndex)^^[0,length) using the function. One of {startIndex,toIndex} must fall within range [0,length).
Updates values in the range [startIndex,toIndex)^^[0,length) using the function. One of {startIndex,toIndex} must fall within range [0,length).
- fromIndex
index of the first value inclusive
- toIndex
index of the last value exclusive
- map
map function
- pred
filter function
- Definition Classes
- Buffer
- Exceptions thrown
IndexOutOfBoundsException
if index lower than zero.
- final def moveRangeLeft(fromIndex: Int, toIndex: Int, distance: Int): ArrayBufferLike.this.type
Moves values in [fromIndex,toIndex) to the left at a distance, to become [fromIndex - distance, toIndex - distance), and moves right any existing values in [fromIndex - distance, fromIndex) to become [toIndex - distance, toIndex).
Moves values in [fromIndex,toIndex) to the left at a distance, to become [fromIndex - distance, toIndex - distance), and moves right any existing values in [fromIndex - distance, fromIndex) to become [toIndex - distance, toIndex). Shifts right first if distance > fromIndex. Ignores negative distance and values outside of [0,length). Moves topIndex if affected.
- Definition Classes
- ArrayBufferLike → Buffer
- final def moveRangeRight(fromIndex: Int, toIndex: Int, distance: Int): ArrayBufferLike.this.type
Moves values in [fromIndex,toIndex) to the right at a distance, to become [fromIndex + distance, toIndex + distance), and moves left any existing values in [toIndex, toIndex + distance) to become [fromIndex, fromIndex + distance).
Moves values in [fromIndex,toIndex) to the right at a distance, to become [fromIndex + distance, toIndex + distance), and moves left any existing values in [toIndex, toIndex + distance) to become [fromIndex, fromIndex + distance). Ignores negative distance and values outside of [0,length). Moves topIndex if affected.
- Definition Classes
- ArrayBufferLike → Buffer
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def nonEmpty: Boolean
Is the accessible part of the buffer non empty?
Is the accessible part of the buffer non empty?
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def optimize(): ArrayBufferLike.this.type
Attempts to optimize buffer storage, if needed.
Attempts to optimize buffer storage, if needed.
- Definition Classes
- ArrayBufferLike → Buffer
- final def peek(offset: Int): T
Returns value at the topIndex - offset.
Returns value at the topIndex - offset.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def peek: T
Returns value at the topIndex.
Returns value at the topIndex.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def peekOption(offset: Int): Option[T]
Returns value at the topIndex - offset.
Returns value at the topIndex - offset.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def pop: T
Returns value at the topIndex, and moves topIndex back.
Returns value at the topIndex, and moves topIndex back.
- Definition Classes
- Buffer
- final def push(value: T): ArrayBufferLike.this.type
Appends value to the topIndex.
- final def remove(index: Int): ArrayBufferLike.this.type
Removes value at index and shifts content in [index+1, length) to the left.
Removes value at index and shifts content in [index+1, length) to the left.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def removeRange(fromIndex: Int, toIndex: Int): ArrayBufferLike.this.type
Removes values in the range [fromIndex, toIndex) and shifts content in [toIndex, length) to the left.
Removes values in the range [fromIndex, toIndex) and shifts content in [toIndex, length) to the left.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def removeWhen(pred: (T) => Boolean): ArrayBufferLike.this.type
Removes values matching the predicate.
Removes values matching the predicate.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def replaceFromArray(index: Int, sourceIndex: Int, replaceLength: Int, sourceArray: Array[T]): ArrayBufferLike.this.type
Replaces current values in the range [index, index + replaceLength) with values of the array range [sourceIndex, sourceIndex + replaceLength).
Replaces current values in the range [index, index + replaceLength) with values of the array range [sourceIndex, sourceIndex + replaceLength).
- Definition Classes
- ArrayBufferLike → Buffer
- final def replaceFromIterator(index: Int, numberOfValues: Int, iterator: Iterator[T]): ArrayBufferLike.this.type
Replaces current values in the range [index, index + min(iterator.length, replaceLength) ) with values returned from the iterator.
Replaces current values in the range [index, index + min(iterator.length, replaceLength) ) with values returned from the iterator.
- Definition Classes
- Buffer
- final def replaceFromIteratorReverse(index: Int, numberOfValues: Int, iterator: Iterator[T]): ArrayBufferLike.this.type
Replaces current values in the range [index, index + min(iterator.length, replaceLength)) with values returned from the iterator in the reverse order.
Replaces current values in the range [index, index + min(iterator.length, replaceLength)) with values returned from the iterator in the reverse order.
- Definition Classes
- Buffer
- final def replaceFromSlice(index: Int, slice: Slice[T]): ArrayBufferLike.this.type
Replaces current values in the range [index, index + slice.length) with values of the slice.
Replaces current values in the range [index, index + slice.length) with values of the slice.
- Definition Classes
- ArrayBufferLike → Buffer
- final def replaceValues(index: Int, sourceIndex: Int, numberOfValues: Int, source: (Int) => T): ArrayBufferLike.this.type
Replaces current values in the range [index, index + replaceLength) with values returned by the function when iterating argument in the range [sourceIndex, sourceIndex + replaceLength).
Replaces current values in the range [index, index + replaceLength) with values returned by the function when iterating argument in the range [sourceIndex, sourceIndex + replaceLength).
- Definition Classes
- Buffer
- final def reset: Int
Resets buffer, sets topIndex to -1.
Resets buffer, sets topIndex to -1. - Does not clear existing values.
- returns
previous topIndex
- Definition Classes
- Buffer
- final def reverseIterator: Iterator[T]
Returns a reverse iterator over actual buffer values, starting from the topIndex down.
Returns a reverse iterator over actual buffer values, starting from the topIndex down.
- Definition Classes
- Buffer
- final def rewind(distance: Int): ArrayBufferLike.this.type
Moves topIndex value left by the distance.
Moves topIndex value left by the distance.
- Definition Classes
- Buffer
- final def set(index: Int): ArrayBufferLike.this.type
Sets topIndex value.
Sets topIndex value.
- Definition Classes
- Buffer
- final def shiftLeft(index: Int, distance: Int): ArrayBufferLike.this.type
Moves values [index, length) left to [index-distance, length - distance).
Moves values [index, length) left to [index-distance, length - distance). Effectively removes range (index-distance, index]. Ignores negative distance. Moves topIndex if affected.
- Definition Classes
- ArrayBufferLike → Buffer
- final def shiftRight(index: Int, distance: Int): ArrayBufferLike.this.type
Moves values [index, length) right to [index+distance, length + distance).
Moves values [index, length) right to [index+distance, length + distance). Effectively creates a new range [index, index+distance). Ignores negative distance. Does not clear existing values inside [index, index+distance). Moves topIndex if affected.
- Definition Classes
- ArrayBufferLike → Buffer
- final def store(value: T): ArrayBufferLike.this.type
Replace value at the topIndex.
Replace value at the topIndex.
- Definition Classes
- Buffer
- final def swap(first: Int, second: Int): ArrayBufferLike.this.type
Swap two values at the provided indexes.
Swap two values at the provided indexes. Value at
first
becomes value atsecond
, and vice versa. - Does nothing if any index falls outside [0,length) or if indexes are equal.- Definition Classes
- Buffer
- final def swapRange(first: Int, second: Int, swapLength: Int): ArrayBufferLike.this.type
Swap values in range [first, first + swapLength) with values in range [second, second + swapLength] - Does nothing if any index falls outside [0,length), or if indexes are equal.
Swap values in range [first, first + swapLength) with values in range [second, second + swapLength] - Does nothing if any index falls outside [0,length), or if indexes are equal. - if [first, first + swapLength) overlaps with [second, second + swapLength) then the later overwrites the former.
- Definition Classes
- ArrayBufferLike → Buffer
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def tail: ArrayBufferLike.this.type
Returns this buffer after decrementing topIndex .
Returns this buffer after decrementing topIndex .
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def toString(): String
- Definition Classes
- ArrayBufferLike → Function1 → AnyRef → Any
- final def top: Int
Returns topIndex value.
Returns topIndex value.
- Definition Classes
- Buffer
- Annotations
- @inline()
- final def touch(index: Int): ArrayBufferLike.this.type
Sets topIndex value if lower than index, otherwise keeps existing.
Sets topIndex value if lower than index, otherwise keeps existing.
- Definition Classes
- Buffer
- final def trim(size: Int): ArrayBufferLike.this.type
Trims the buffer, if needed, to have at most the
size
.Trims the buffer, if needed, to have at most the
size
.- Definition Classes
- Buffer
- final def update(index: Int, value: T): ArrayBufferLike.this.type
Updates value at the provided index.
Updates value at the provided index. Alters underlying array if necessary.
- Definition Classes
- ArrayBufferLike → Buffer
- Exceptions thrown
IndexOutOfBoundsException
if index lower than zero.
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Abstract
Export
Internal
Update
Properties
List-like
List like operations, head is the top element
Stack-like
Stack like operations, peek takes the top element
Slice
Append
Insert
Modify
Replace
Remove
Shift
Move
Swap
Limit
Manipulations of the topIndex