trait Buffer[T] extends (Int) ⇒ T
Mutable indexed buffer abstraction.
- Grouped
- Alphabetic
- By Inheritance
- Buffer
- Function1
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
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
ensureIndex(index: Int): Unit
Ensures buffer capacity to address provided index.
Ensures buffer capacity to address provided index.
- Attributes
- protected
-
abstract
def
insertArray(index: Int, sourceIndex: Int, insertLength: Int, sourceArray: Array[T]): Buffer.this.type
Shift current content to the right starting from
indexat theinsertLengthdistance, and copies array chunk into the gap.Shift current content to the right starting from
indexat theinsertLengthdistance, and copies array chunk into the gap. Sets topIndex to be at least at the end of the new chunk of values. -
abstract
def
shiftLeft(index: Int, distance: Int): Buffer.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.
-
abstract
def
shiftRight(index: Int, distance: Int): Buffer.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.
-
abstract
def
toArray: Array[T]
Returns an Array representing accessible buffer range.
-
abstract
def
toSlice: Slice[T]
Returns a Slice representing accessible buffer range.
-
abstract
def
update(index: Int, value: T): Buffer.this.type
Updates value at the provided index.
Updates value at the provided index.
- Exceptions thrown
IndexOutOfBoundsExceptionif index lower than zero.
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): Buffer.this.type
Appends value at the end of buffer and advances topIndex.
Appends value at the end of buffer and advances topIndex.
- Annotations
- @inline()
-
final
def
appendArray(values: Array[T]): Buffer.this.type
Appends values from the given array at the end of buffer and advances topIndex.
Appends values from the given array at the end of buffer and advances topIndex.
- Annotations
- @inline()
-
final
def
appendFromIterator(iterator: Iterator[T]): Buffer.this.type
Appends values from the given iterator at the end of buffer and advances topIndex.
-
final
def
appendIterable(iterable: Iterable[T]): Buffer.this.type
Appends values from the given iterable at the end of buffer and advances topIndex.
Appends values from the given iterable at the end of buffer and advances topIndex.
- Annotations
- @inline()
-
final
def
appendSequence(values: IndexedSeq[T]): Buffer.this.type
Appends values from the given sequence at the end of buffer and advances topIndex.
Appends values from the given sequence at the end of buffer and advances topIndex.
- Annotations
- @inline()
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
compose[A](g: (A) ⇒ Int): (A) ⇒ T
- Definition Classes
- Function1
- Annotations
- @unspecialized()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
insertFromIterator(index: Int, insertLength: Int, iterator: Iterator[T]): Buffer.this.type
Shift current content to the right starting from
indexat theinsertLengthdistance, and copies iterated values into the gap.Shift current content to the right starting from
indexat theinsertLengthdistance, and copies iterated values into the gap. Sets topIndex to be at least at the end of the new chunk of values. -
final
def
insertValues(index: Int, sourceIndex: Int, insertLength: Int, source: (Int) ⇒ T): Buffer.this.type
Shift current content to the right starting from
indexat theinsertLengthdistance, iterates over the source indexes and copies values into the gap.Shift current content to the right starting from
indexat theinsertLengthdistance, 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. -
final
def
isEmpty: Boolean
Is the accessible part of the buffer empty?
Is the accessible part of the buffer empty?
- Annotations
- @inline()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
length: Int
Length of the accessible part of the buffer.
-
def
modify(index: Int, f: (T) ⇒ T): Buffer.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).
- Exceptions thrown
IndexOutOfBoundsExceptionif index lower than zero.
-
def
modifyRange(fromIndex: Int, toIndex: Int, f: (T) ⇒ T): Buffer.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).
- Exceptions thrown
IndexOutOfBoundsExceptionif index lower than zero.
-
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?
- Annotations
- @inline()
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
peek: T
Returns value at the topIndex.
-
final
def
pop: T
Returns value at the topIndex, and moves topIndex back.
-
final
def
push(value: T): Buffer.this.type
Appends value to the topIndex.
Appends value to the topIndex. Same as append
- Annotations
- @inline()
-
final
def
reset: Int
Resets buffer, sets topIndex to -1.
Resets buffer, sets topIndex to -1. Does not clear existing values.
- returns
previous topIndex
-
final
def
set(index: Int): Buffer.this.type
Sets topIndex value.
-
final
def
store(value: T): Buffer.this.type
Replace value at the topIndex.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Function1 → AnyRef → Any
-
final
def
top: Int
Returns topIndex value.
-
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( ... ) @native()