in scala.collection.mutable
class Buffer

mixin abstract class Buffer [ A ]
extends java.lang.Object
with Seq
with Scriptable
with ScalaObject
Buffers are used to create sequences of elements incrementally by appending, prepending, or inserting new elements. It is also possible to access and modify elements in a random access fashion via the index of the element in the current sequence.
author:
Matthias Zenger
version:
1.1, 02/03/2004

Def Summary
def + ( elem : A ) : Buffer
Append a single element to this buffer and return the identity of the buffer.
def ++ ( elems : Iterable ) : Buffer
Appends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
def ++ ( iter : Iterator ) : Buffer
Appends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
def ++: ( iter : Iterable ) : Buffer
Prepends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
def ++= ( elems : Iterable ) : scala.Unit
Appends a number of elements provided by an iterable object via its elements method.
def ++= ( it : Iterator ) : scala.Unit
Appends a number of elements provided by an iterable object via its elements method.
def +: ( elem : A ) : Buffer
Prepend a single element to this buffer and return the identity of the buffer.
def += ( elem : A ) : scala.Unit
Append a single element to this buffer.
def << ( cmd : Message ) : scala.Unit
Send a message to this scriptable object.
def append ( elems : scala.<repeated> ) : scala.Unit
Appends a sequence of elements to this buffer.
def appendAll ( iter : Iterable ) : scala.Unit
Appends a number of elements provided by an iterable object via its elements method.
def clear : scala.Unit
Clears the buffer contents.
override def clone : Buffer
Return a clone of this buffer.
override def hashCode : scala.Int
The hashCode method always yields an error, since it is not safe to use buffers as keys in hash tables.
def insert ( n : scala.Int , elems : scala.<repeated> ) : scala.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.
def insertAll ( n : scala.Int , iter : Iterable ) : scala.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.
def prepend ( elems : scala.<repeated> ) : scala.Unit
Prepend an element to this list.
def prependAll ( elems : Iterable ) : scala.Unit
Prepends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
def remove ( n : scala.Int ) : A
Removes the element on a given index position.
override protected def stringPrefix : java.lang.String
Defines the prefix of the string representation.
def trimEnd ( n : scala.Int ) : scala.Unit
Removes the last n elements.
def trimStart ( n : scala.Int ) : scala.Unit
Removes the first n elements.
def update ( n : scala.Int , newelem : A ) : scala.Unit
Replace element at index n with the new element newelem.


Def Detail
def + ( elem : A ) : Buffer
Append a single element to this buffer and return the identity of the buffer.
param:
elem the element to append.

def ++ ( elems : Iterable ) : Buffer
Appends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
param:
iter the iterable object.

def ++ ( iter : Iterator ) : Buffer
Appends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
param:
iter the iterable object.

def ++: ( iter : Iterable ) : Buffer
Prepends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
param:
iter the iterable object.

def ++= ( elems : Iterable ) : scala.Unit
Appends a number of elements provided by an iterable object via its elements method.
param:
iter the iterable object.

def ++= ( it : Iterator ) : scala.Unit
Appends a number of elements provided by an iterable object via its elements method.
param:
iter the iterable object.

def +: ( elem : A ) : Buffer
Prepend a single element to this buffer and return the identity of the buffer.
param:
elem the element to append.

def += ( elem : A ) : scala.Unit
Append a single element to this buffer.
param:
elem the element to append.

def << ( cmd : Message ) : scala.Unit
Send a message to this scriptable object.
param:
cmd the message to send.

def append ( elems : scala.<repeated> ) : scala.Unit
Appends a sequence of elements to this buffer.
param:
elems the elements to append.

def appendAll ( iter : Iterable ) : scala.Unit
Appends a number of elements provided by an iterable object via its elements method.
param:
iter the iterable object.

def clear : scala.Unit
Clears the buffer contents.

override def clone : Buffer
Return a clone of this buffer.
return:
a buffer with the same elements.

override def hashCode : scala.Int
The hashCode method always yields an error, since it is not safe to use buffers as keys in hash tables.
return:
never.

def insert ( n : scala.Int , elems : scala.<repeated> ) : scala.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.
param:
n the index where a new element will be inserted.
param:
elems the new elements to insert.

def insertAll ( n : scala.Int , iter : Iterable ) : scala.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.
param:
n the index where a new element will be inserted.
param:
iter the iterable object providing all elements to insert.

def prepend ( elems : scala.<repeated> ) : scala.Unit
Prepend an element to this list.
param:
elem the element to prepend.

def prependAll ( elems : Iterable ) : scala.Unit
Prepends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
param:
iter the iterable object.

def remove ( n : scala.Int ) : A
Removes the element on a given index position.
param:
n the index which refers to the element to delete.

override protected def stringPrefix : java.lang.String
Defines the prefix of the string representation.

def trimEnd ( n : scala.Int ) : scala.Unit
Removes the last n elements.
param:
n the number of elements to remove from the end of this buffer.

def trimStart ( n : scala.Int ) : scala.Unit
Removes the first n elements.
param:
n the number of elements to remove from the beginning of this buffer.

def update ( n : scala.Int , newelem : A ) : scala.Unit
Replace element at index n with the new element newelem.
param:
n the index of the element to replace.
param:
newelem the new element.