ArrayBuffer
Growable, mutable array of values.
- Type Params
- T
-
type of the underlying array items
- Companion
- object
Document{}
Returns a reverse iterator over actual buffer values,
starting from the topIndex down.
starting from the topIndex down.
- Inhertied from
- Buffer
Replaces current values in the range [index, index + min(iterator.length, replaceLength) )
with values returned from the iterator.
with values returned from the iterator.
- Inhertied from
- Buffer
Replaces current values in the range [index, index + slice.length) with values of the slice.
- Definition Classes
- Inhertied from
- ArrayBufferLike
Shift current content to the right starting from
and inserts iterated values into the gap.
- Sets topIndex to be at least at the end of the new chunk of values.
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.
- Inhertied from
- Buffer
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.
- Sets topIndex to be at least at the end of the new chunk of values.
- Inhertied from
- Buffer
@inline
Appends values from the given iterable at the end of the buffer and advances topIndex.
- Inhertied from
- Buffer
@inline
Iterable representing lazily mapped values of this buffer at the time of access.
- Value Params
- f
-
map function
- Inhertied from
- Buffer
final override def replaceFromArray(index: Int, sourceIndex: Int, replaceLength: Int, sourceArray: Array[T]): ArrayBufferLike
Replaces current values in the range [index, index + replaceLength)
with values of the array range [sourceIndex, sourceIndex + replaceLength).
with values of the array range [sourceIndex, sourceIndex + replaceLength).
- Definition Classes
- Inhertied from
- ArrayBufferLike
Shifts content in [index, length) one step to the right and updates value at index.
- Inhertied from
- Buffer
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.
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
- Inhertied from
- ArrayBufferLike
@inline
Appends values from the given slice at the end of the buffer and advances topIndex.
- Inhertied from
- Buffer
Returns an iterator over actual buffer values,
starting from the zero index up.
starting from the zero index up.
- Note
- does not copy buffer values,
- Inhertied from
- Buffer
Updates all accepted values in the range [0,length) using the function.
- Value Params
- map
-
map function
- pred
-
filter function
- Inhertied from
- Buffer
Resets buffer, sets topIndex to -1.
- Does not clear existing values.
- Does not clear existing values.
- Returns
-
previous topIndex
- Inhertied from
- Buffer
Updates all values in the range [0,length) using the function.
- Value Params
- map
-
map function
- Inhertied from
- Buffer
Shift current content to the right starting from
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.
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.
- Inhertied from
- Buffer
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.
- Sets topIndex to be at least at the end of the new chunk of values.
- Inhertied from
- Buffer
final override def insertArray(index: Int, sourceIndex: Int, insertLength: Int, sourceArray: Array[T]): ArrayBufferLike
Shift current content to the right starting from
and copies array chunk into the gap.
Sets topIndex to be at least at the end of the new chunk of values.
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.
- Definition Classes
- Inhertied from
- ArrayBufferLike
@inline
Appends values from the given sequence at the end of the buffer and advances topIndex.
- Inhertied from
- Buffer
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.
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
- Inhertied from
- ArrayBufferLike
@inline
Appends number of values from the given iterator at the end of the buffer and advances topIndex.
- Inhertied from
- Buffer
Appends values from the given iterator at the end of the buffer and advances topIndex.
- Inhertied from
- Buffer
@inline
Appends values from the given array at the end of the buffer and advances topIndex.
- Inhertied from
- Buffer
final def replaceFromIteratorReverse(index: Int, numberOfValues: Int, iterator: Iterator[T]): Buffer
Replaces current values in the range [index, index + min(iterator.length, replaceLength))
with values returned from the iterator in the reverse order.
with values returned from the iterator in the reverse order.
- Inhertied from
- Buffer
Updates values in the range [startIndex,toIndex)^^[0,length) using the function.
One of {startIndex,toIndex} must fall within range [0,length).
One of {startIndex,toIndex} must fall within range [0,length).
- Value Params
- fromIndex
-
index of the first value inclusive
- map
-
map function
- toIndex
-
index of the last value exclusive
- Throws
- IndexOutOfBoundsException
- IndexOutOfBoundsException
- Inhertied from
- Buffer
Shift current content to the right starting from
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.
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.
- Inhertied from
- Buffer
@inline
Removes values in the range [fromIndex, toIndex) and shifts content in [toIndex, length) to the left.
- Inhertied from
- Buffer
final def replaceValues(index: Int, sourceIndex: Int, numberOfValues: Int, source: Int => T): Buffer
Replaces current values in the range [index, index + replaceLength) with values returned by the function
when iterating argument in the range [sourceIndex, sourceIndex + replaceLength).
when iterating argument in the range [sourceIndex, sourceIndex + replaceLength).
- Inhertied from
- Buffer
@inline
Removes value at index and shifts content in [index+1, length) to the left.
- Inhertied from
- Buffer
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.
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
- Inhertied from
- ArrayBufferLike
Updates values in the range [startIndex,toIndex)^^[0,length) using the function.
One of {startIndex,toIndex} must fall within range [0,length).
One of {startIndex,toIndex} must fall within range [0,length).
- Value Params
- fromIndex
-
index of the first value inclusive
- map
-
map function
- pred
-
filter function
- toIndex
-
index of the last value exclusive
- Throws
- IndexOutOfBoundsException
- IndexOutOfBoundsException
- Inhertied from
- Buffer
Updates value at the provided index using the function.
Index must fall within range [0,length).
Index must fall within range [0,length).
- Value Params
- index
-
value's index
- map
-
map function
- Throws
- IndexOutOfBoundsException
- IndexOutOfBoundsException
- Inhertied from
- Buffer
Shift current content to the right starting from
and copies slice content into the gap.
Sets topIndex to be at least at the end of the new chunk of values.
index
at the slice.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
- Inhertied from
- ArrayBufferLike
Updates value at the provided index.
Alters underlying array if necessary.
Alters underlying array if necessary.
- Throws
- IndexOutOfBoundsException
- IndexOutOfBoundsException
- Definition Classes
- Inhertied from
- ArrayBufferLike
Swap two values at the provided indexes.
Value at
- Does nothing if any index falls outside [0,length) or if indexes are equal.
Value at
first
becomes value at second
, and vice versa.- Does nothing if any index falls outside [0,length) or if indexes are equal.
- Inhertied from
- Buffer
Moves values [index, length) left to [index-distance, length - distance).
Effectively removes range (index-distance, index]
.
Ignores negative distance.
Moves topIndex if affected.
Ignores negative distance.
Moves topIndex if affected.
- Definition Classes
- Inhertied from
- ArrayBufferLike
@inline
Updates in-place all values in the range [0,length) using the function.
- Value Params
- f
-
map function
- Inhertied from
- Buffer
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.
- 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
- Inhertied from
- ArrayBufferLike
Value members
Methods
Returns value at the given index.
- Throws
- IndexOutOfBoundsException
- IndexOutOfBoundsException
- Definition Classes
- Buffer -> Function1