Mutable indexed buffer abstraction. All modifications happens in-place.
In addition, the Buffer API offers both Stack- and List-like interfaces. For the purpose of the List-like processing, the head is a top element in the buffer.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Int => Tclass Objecttrait Matchableclass Any
- Known subtypes
-
trait ArrayBufferLike[T]class ArrayBuffer[T]class ByteBufferclass DeferredArrayBuffer[T]class IntBuffer
Members list
Value members
Abstract methods
Returns value at the provided index.
Returns value at the provided index.
Attributes
Returns a trimmed copy of an underlying array.
Returns a trimmed copy of an underlying array.
Attributes
Wraps accessible internal state as a Slice without making any copy.
Wraps accessible internal state as a Slice without making any copy.
Attributes
Creates a copy of this buffer.
Creates a copy of this buffer.
Attributes
Shift current content to the right starting from index
at the insertLength
distance, and copies array chunk into the gap.
Shift current content to the right starting from index
at the insertLength
distance, and copies array chunk into the gap.
- Sets topIndex to be at least at the end of the new chunk of values.
Attributes
Shift current content to the right starting from index
at the slice.length
distance, and copies slice into the gap.
Shift current content to the right starting from index
at the slice.length
distance, and copies slice into the gap.
- Sets topIndex to be at least at the end of the new chunk of values.
Attributes
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, toIndex + distance).
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, toIndex + distance).
- Ignores negative distance.
- Does nothing if fromIndex > topIndex.
- Moves topIndex if affected.
Attributes
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.
- Does nothing if fromIndex > topIndex.
- Moves topIndex if affected.
Attributes
Attempts to optimize buffer storage, if needed.
Attempts to optimize buffer storage, if needed.
Attributes
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).
Attributes
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.
Attributes
Moves values in [index, length) left to [index-distance, length - distance). Effectively removes range (index-distance, index].
Moves values in [index, length) left to [index-distance, length - distance). Effectively removes range (index-distance, index].
- Ignores negative distance.
- Moves topIndex if affected.
Attributes
Moves values in [index, length) right to [index+distance, length + distance). Effectively creates a new range [index, index+distance).
Moves values in [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.
Attributes
Takes range and returns a Slice.
Takes range and returns a Slice.
Attributes
Swap values in range [first, first + swapLength) with values in range [second, second + swapLength)
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.
Attributes
Returns a trimmed copy of an underlying array.
Returns a trimmed copy of an underlying array.
Attributes
Concrete methods
Appends value at the end of the buffer and advances topIndex.
Appends value at the end of the buffer and advances topIndex.
Attributes
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.
Attributes
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.
Attributes
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.
Attributes
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.
Attributes
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.
Attributes
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.
Attributes
Returns true if buffer contains given value.
Returns true if buffer contains given value.
Attributes
Returns true if buffer contains value fulfilling the predicate.
Returns true if buffer contains value fulfilling the predicate.
Attributes
Moves topIndex value right by the distance.
Moves topIndex value right by the distance.
Attributes
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.
Attributes
Returns value at the topIndex.
Returns value at the topIndex.
Attributes
Returns Some value at the topIndex or None if empty buffer.
Returns Some value at the topIndex or None if empty buffer.
Attributes
Returns this buffer without a first element.
Returns this buffer without a first element.
Attributes
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.
Attributes
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.
Attributes
Shift current content to the right starting from index
at the min(iterator.length, insertLength)
distance, and inserts iterated values into the gap.
Shift current content to the right starting from index
at the min(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.
Attributes
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.
Attributes
Shift current content to the right starting from index
at the min(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 the min(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.
Attributes
Shift current content to the right starting from index
at the insertLength
distance, iterates over the source indexes and copies values into the gap.
Shift current content to the right starting from index
at the insertLength
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.
Attributes
Is the accessible part of the buffer empty?
Is the accessible part of the buffer empty?
Attributes
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.
Attributes
- Note
-
does not copy buffer values,
Returns value at the zero index.
Returns value at the zero index.
Attributes
Returns Some value at the zero index, or None if empty buffer.
Returns Some value at the zero index, or None if empty buffer.
Attributes
Length of the accessible part of the buffer.
Length of the accessible part of the buffer.
Attributes
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.
Value parameters
- f
-
map function
Attributes
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.
Value parameters
- f
-
map function
Attributes
Updates value at the provided index using the function. Index must fall within range [0,length).
Updates value at the provided index using the function. Index must fall within range [0,length).
Value parameters
- index
-
value's index
- map
-
map function
Attributes
- Throws
-
IndexOutOfBoundsException
if index lower than zero.
Updates all values in the range [0,length) using the function.
Updates all values in the range [0,length) using the function.
Value parameters
- map
-
map function
Attributes
Updates all accepted values in the range [0,length) using the function.
Updates all accepted values in the range [0,length) using the function.
Value parameters
- map
-
map function
- pred
-
filter function
Attributes
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).
Value parameters
- fromIndex
-
index of the first value inclusive
- map
-
map function
- toIndex
-
index of the last value exclusive
Attributes
- Throws
-
IndexOutOfBoundsException
if index lower than zero.
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).
Value parameters
- fromIndex
-
index of the first value inclusive
- map
-
map function
- pred
-
filter function
- toIndex
-
index of the last value exclusive
Attributes
- Throws
-
IndexOutOfBoundsException
if index lower than zero.
Is the accessible part of the buffer non empty?
Is the accessible part of the buffer non empty?
Attributes
Returns value at the topIndex.
Returns value at the topIndex.
Attributes
Returns value at the topIndex - offset.
Returns value at the topIndex - offset.
Attributes
Returns value at the topIndex - offset.
Returns value at the topIndex - offset.
Attributes
Returns value at the topIndex, and moves topIndex back.
Returns value at the topIndex, and moves topIndex back.
Attributes
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.
Attributes
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.
Attributes
Removes values matching the predicate.
Removes values matching the predicate.
Attributes
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.
Attributes
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.
Attributes
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).
Attributes
Resets buffer, sets topIndex to -1.
Resets buffer, sets topIndex to -1.
- Does not clear existing values.
Attributes
- Returns
-
previous topIndex
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.
Attributes
Moves topIndex value left by the distance.
Moves topIndex value left by the distance.
Attributes
Replace value at the topIndex.
Replace value at the topIndex.
Attributes
Swap two values at the provided indexes. Value at first
becomes value at second
, and vice versa.
Swap two values at the provided indexes. Value at first
becomes value at second
, and vice versa.
- Does nothing if any index falls outside [0,length) or if indexes are equal.
Attributes
Returns this buffer after decrementing topIndex .
Returns this buffer after decrementing topIndex .
Attributes
Returns topIndex value.
Returns topIndex value.
Attributes
Sets topIndex value if lower than index, otherwise keeps existing.
Sets topIndex value if lower than index, otherwise keeps existing.
Attributes
Inherited methods
Attributes
- Inherited from:
- Function1
Attributes
- Inherited from:
- Function1
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Function1 -> Any
- Inherited from:
- Function1