Scala Library
|
|
trait
BufferTemplate[A, +This <: BufferTemplate[A, This] with
Buffer[A]]
extends
Growable[A] with
Shrinkable[A] with
Scriptable[A] with
Addable[A, This] with
Subtractable[A, This] with
Cloneable[This] with
SequenceTemplate[A, This]Method Summary | |
override def
|
+
(elem1 : A, elem2 : A, elems : A*) : This
Adds two or more elements to this collection and returns
the collection itself.
|
override def
|
+
(elem : A) : This
Adds a single element to this collection and returns
the collection itself.
|
override def
|
++
(iter : Traversable[A]) : This
Adds a number of elements provided by a traversable object and returns
either the collection itself.
|
override def
|
++
(iter : Iterator[A]) : This
Adds a number of elements provided by an iterator and returns
the collection itself.
|
def
|
++:
(iter : Iterator[A]) : This
Prepends a number of elements provided by an iterator
The identity of the buffer is returned.
|
def
|
++:
(iter : Traversable[A]) : This
Prepends a number of elements provided by an iterable object
via its
iterator method. The identity of the
buffer is returned.(thisCollection /: elems) (_ plus _) |
def
|
++=
(src : Array[A], start : Int, len : Int) : Unit
Adds a number of elements in an array
|
abstract def
|
+:
(elem : A) : This
Prepend a single element to this buffer and return
the identity of the buffer.
|
abstract def
|
+=
(elem : A) : BufferTemplate[A, This]
Append a single element to this buffer.
|
override def
|
-
(elem1 : A, elem2 : A, elems : A*) : This
Removes two or more elements from this collection and returns
the collection itself.
|
override def
|
-
(elem : A) : This
Removes a single element from this collection and returns
the collection itself.
|
override def
|
--
(iter : Iterator[A]) : This
Removes a number of elements provided by an iterator and returns
the collection itself.
|
override def
|
--
(iter : Traversable[A]) : This
Removes a number of elements provided by a traversible object and returns
the collection itself.
|
def
|
-=
(x : A) : BufferTemplate[A, This]
Removes a single element from this buffer, at its first occurrence.
If the buffer does not contain that element, it is unchanged.
|
def
|
<<
(cmd : Message[A]) : Unit
Send a message to this scriptable object.
|
def
|
append
(elems : A*) : Unit
Appends elements to this buffer.
|
def
|
appendAll
(iter : Traversable[A]) : Unit
Appends a number of elements provided by an iterable object
via its
iterator method. |
abstract def
|
apply
(n : Int) : A
Return element at index `n`
|
abstract def
|
clear
: Unit
Clears the buffer contents.
|
def
|
insert
(n : Int, elems : A*) : Unit
Inserts new elements at the index
n . Opposed to method
update , this method will not replace an element with a
one. Instead, it will insert the new elements at index n . |
abstract def
|
insertAll
(n : Int, iter : Traversable[A]) : Unit
Inserts new elements at the index
n . Opposed to method
update , this method will not replace an element with a
one. Instead, it will insert a new element at index n . |
abstract def
|
length
: Int
Return number of elements in the buffer
|
def
|
prepend
(elems : A*) : Unit
Prepend given elements to this list.
|
def
|
prependAll
(iter : Iterator[A]) : Unit
Prepends a number of elements provided by an iterable object
via its
iterator method. The identity of the
buffer is returned. |
def
|
prependAll
(iter : Traversable[A]) : Unit
Prepends a number of elements provided by an iterable object
via its
iterator method. The identity of the
buffer is returned. |
def
|
remove
(n : Int, count : Int) : Unit
Removes a number of elements from a given index position.
|
abstract def
|
remove
(n : Int) : A
Removes the element on a given index position.
|
override def
|
stringPrefix
: java.lang.String
Defines the prefix of the string representation.
|
def
|
trimEnd
(n : Int) : Unit
Removes the last
n elements. |
def
|
trimStart
(n : Int) : Unit
Removes the first
n elements. |
abstract def
|
update
(n : Int, newelem : A) : Unit
Replace element at index
n with the new element
newelem . |
Methods inherited from SequenceTemplate | |
lengthCompare, size, isDefinedAt, zip, zipAll, zipWithIndex, segmentLength, prefixLength, indexWhere, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, lastIndexWhere, reverse, reverseIterator, reversedElements, startsWith, startsWith, endsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, patch, padTo, toSequence, indices, view, view, equals, toString, sortWith, findLastIndexOf, slice, equalsWith, containsSlice, projection |
Methods inherited from IterableTemplate | |
iterator (abstract), elements, foreach, isEmpty, foldRight, reduceRight, toIterable, head, takeRight, dropRight, sameElements, toStream, first, firstOption, toSeq |
Methods inherited from TraversableTemplate | |
newBuilder (abstract), thisCollection, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterMap, filterNot, remove, partition, groupBy, forall, exists, count, find, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, headOption, tail, last, lastOption, init, take, drop, slice, takeWhile, dropWhile, span, splitAt, copyToBuffer, copyToArray, copyToArray, toArray, toList, toSet, mkString, mkString, mkString, addString, addString, addString |
Methods inherited from Cloneable | |
clone |
Methods inherited from Shrinkable | |
-=, --=, --= |
Methods inherited from Growable | |
+=, ++=, ++= |
Methods inherited from AnyRef | |
getClass, hashCode, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
IndexOutofBoundsException -
if the index is not validn
with the new element
newelem
.n -
the index of the element to replace.newelem -
the new element.IndexOutofBoundsException -
if the index is not validabstract
def
length : Int
abstract
def
+=(elem : A) : BufferTemplate[A, This]
elem -
the element to append.abstract
def
clear : Unit
elem -
the element to prepend.abstract
def
insertAll(n : Int, iter : Traversable[A]) : Unit
n
. Opposed to method
update
, this method will not replace an element with a
one. Instead, it will insert a new element at index n
.n -
the index where a new element will be inserted.iter -
the iterable object providing all elements to insert.IndexOutofBoundsException -
if the index is not validn -
the index which refers to the element to delete.n -
the index which refers to the element to delete.count -
the number of elements to deleteIndexOutofBoundsException -
if the index is not valid
def
-=(x : A) : BufferTemplate[A, This]
x -
the element to remove.
def
++:(iter : Traversable[A]) : This
iterator
method. The identity of the
buffer is returned.(thisCollection /: elems) (_ plus _)iter -
the iterable object.iter -
the iteratorelems -
the elements to append.
def
appendAll(iter : Traversable[A]) : Unit
iterator
method.iter -
the iterable object.elem -
the element to prepend.
def
prependAll(iter : Traversable[A]) : Unit
iterator
method. The identity of the
buffer is returned.iter -
the iterable object.iterator
method. The identity of the
buffer is returned.iter -
the iterable object.n
. Opposed to method
update
, this method will not replace an element with a
one. Instead, it will insert the new elements at index n
.n -
the index where a new element will be inserted.elems -
the new elements to insert.n
elements.n -
the number of elements to remove from the beginning of this buffer.n
elements.n -
the number of elements to remove from the end of this buffer.cmd -
the message to send.override
def
stringPrefix : java.lang.String
def
++=(src : Array[A], start : Int, len : Int) : Unit
src -
the arraystart -
the first element to appendlen -
the number of elements to appendoverride
def
+(elem : A) : This
elem -
the element to add.override
def
+(elem1 : A, elem2 : A, elems : A*) : This
elem1 -
the first element to add.elem2 -
the second element to add.elems -
the remaining elements to add.override
def
++(iter : Traversable[A]) : This
iter -
the iterable object.override
def
++(iter : Iterator[A]) : This
iter -
the iteratoroverride
def
-(elem : A) : This
elem -
the element to remove.override
def
-(elem1 : A, elem2 : A, elems : A*) : This
elem1 -
the first element to remove.elem2 -
the second element to remove.elems -
the remaining elements to remove.override
def
--(iter : Traversable[A]) : This
iter -
the iterable object.override
def
--(iter : Iterator[A]) : This
iter -
the iterator
Scala Library
|
|