scala.collection.mutable

trait BufferProxy

[source: scala/collection/mutable/BufferProxy.scala]

trait BufferProxy[A]
extends Buffer[A] with Proxy
This is a simple proxy class for scala.collection.mutable.Buffer. It is most useful for assembling customized set abstractions dynamically using object composition and forwarding.
Author
Matthias Zenger
Version
1.0, 16/04/2004
Method Summary
override def + (elem : A) : Buffer[A]
Append a single element to this buffer and return the identity of the buffer.
override def ++ (iter : Iterable[A]) : Buffer[A]
Appends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
override def ++: (iter : Iterable[A]) : Buffer[A]
Prepends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
override def ++= (iter : Iterable[A]) : Unit
Appends a number of elements provided by an iterable object via its elements method.
def +: (elem : A) : Buffer[A]
Prepend a single element to this buffer and return the identity of the buffer.
def += (elem : A) : Unit
Append a single element to this buffer.
override def << (cmd : Message[(Location, A)]) : Unit
Send a message to this scriptable object.
override def append (elems : A*) : Unit
Appends a sequence of elements to this buffer.
override def appendAll (iter : Iterable[A]) : Unit
Appends a number of elements provided by an iterable object via its elements method.
def apply (n : Int) : A
def clear : Unit
Clears the buffer contents.
override def clone : Buffer[A]
Return a clone of this buffer.
override def elements : Iterator[A]
Creates a new iterator over all elements contained in this object.
override 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.
def insertAll (n : Int, iter : Iterable[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.
def length : Int
Returns the length of the sequence.
override def prepend (elems : A*) : Unit
Prepend an element to this list.
override def prependAll (elems : Iterable[A]) : Unit
Prepends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
override def readOnly : Seq[A]
return a read only alias of this buffer
def remove (n : Int) : A
Removes the element on a given index position.
abstract def self : Buffer[A]
def update (n : Int, newelem : A) : Unit
Replace element at index n with the new element newelem.
Methods inherited from Proxy
hashCode, equals, toString
Methods inherited from Buffer
++=, ++=, ++, ++, -=, trimStart, trimEnd, stringPrefix
Methods inherited from Seq
lengthCompare, size, isEmpty, concat, last, lastOption, headOption, isDefinedAt, lastIndexOf, map, flatMap, filter, take, drop, slice, takeWhile, dropWhile, reverse, contains, subseq, toArray, projection, equalsWith, startsWith, endsWith, indexOf, containsSlice
Methods inherited from Iterable
foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toStream, mkString, mkString, mkString, addString, addString, copyToArray, hasDefiniteSize
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from AnyRef
getClass, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
abstract def self : Buffer[A]
Overrides
Proxy.self

def length : Int
Returns the length of the sequence.
Returns
the sequence length.

override def elements : Iterator[A]
Creates a new iterator over all elements contained in this object.
Returns
the new iterator

def apply(n : Int) : A

override def +(elem : A) : Buffer[A]
Append a single element to this buffer and return the identity of the buffer.
Parameters
elem - the element to append.
Returns
the updated buffer.
Overrides
Buffer.+

def +=(elem : A) : Unit
Append a single element to this buffer.
Parameters
elem - the element to append.
Overrides
Buffer.+=

override def readOnly : Seq[A]
return a read only alias of this buffer
Overrides
Buffer.readOnly

override def ++(iter : Iterable[A]) : Buffer[A]
Appends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
Parameters
iter - the iterable object.
Returns
the updated buffer.
Overrides
Buffer.++

override def ++=(iter : Iterable[A]) : Unit
Appends a number of elements provided by an iterable object via its elements method.
Parameters
iter - the iterable object.
Overrides
Buffer.++=

override def append(elems : A*) : Unit
Appends a sequence of elements to this buffer.
Parameters
elems - the elements to append.
Overrides
Buffer.append

override def appendAll(iter : Iterable[A]) : Unit
Appends a number of elements provided by an iterable object via its elements method.
Parameters
iter - the iterable object.
Overrides
Buffer.appendAll

def +:(elem : A) : Buffer[A]
Prepend a single element to this buffer and return the identity of the buffer.
Parameters
elem - the element to append.
Overrides
Buffer.+:

override def ++:(iter : Iterable[A]) : Buffer[A]
Prepends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
Parameters
iter - the iterable object.
Overrides
Buffer.++:

override def prepend(elems : A*) : Unit
Prepend an element to this list.
Parameters
elem - the element to prepend.
Overrides
Buffer.prepend

override def prependAll(elems : Iterable[A]) : Unit
Prepends a number of elements provided by an iterable object via its elements method. The identity of the buffer is returned.
Parameters
iter - the iterable object.
Overrides
Buffer.prependAll

override 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.
Parameters
n - the index where a new element will be inserted.
elems - the new elements to insert.
Overrides
Buffer.insert

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

def update(n : Int, newelem : A) : Unit
Replace element at index n with the new element newelem.
Parameters
n - the index of the element to replace.
newelem - the new element.
Overrides
Buffer.update

def remove(n : Int) : A
Removes the element on a given index position.
Parameters
n - the index which refers to the element to delete.
Overrides
Buffer.remove

def clear : Unit
Clears the buffer contents.
Overrides
Buffer.clear

override def <<(cmd : Message[(Location, A)]) : Unit
Send a message to this scriptable object.
Parameters
cmd - the message to send.
Overrides
Buffer.<<

override def clone : Buffer[A]
Return a clone of this buffer.
Returns
a Buffer with the same elements.
Overrides
Buffer.clone