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
Since
1
Method Summary
override def + (elem : A) : Buffer[A]
Append a single element to this buffer and return the identity of the buffer.
def ++ (iter : Iterable[A]) : Buffer[A]
Appends a number of elements provided by an iterable object via its iterator method. The identity of the buffer is returned.
def ++= (iter : Iterable[A]) : BufferProxy[A]
Appends a number of elements provided by an iterable object via its iterator method.
override def ++=: (iter : Iterator[A]) : Buffer[A]
Prepends a number of elements provided by an iterator The identity of the buffer is returned.
override def ++=: (iter : Traversable[A]) : Buffer[A]
Prepends a number of elements provided by an iterable object via its iterator method. The identity of the buffer is returned.(repr /: elems) (_ plus _)
def += (elem : A) : BufferProxy[A]
Append a single element to this buffer.
def +=: (elem : A) : Buffer[A]
Prepend a single element to this buffer and return the identity of the buffer.
override def << (cmd : Message[A]) : Unit
Send a message to this scriptable object.
override def append (elems : A*) : Unit
Appends a sequence of elements to this buffer.
def appendAll (iter : Iterable[A]) : Unit
Appends a number of elements provided by an iterable object via its iterator method.
def apply (n : Int) : A
Return element at index `n`
def clear : Unit
Clears the buffer contents.
override def clone : Buffer[A]
Return a clone of this buffer.
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.
override 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.
override def iterator : Iterator[A]
Creates a new iterator over all elements contained in this iterable object.
def length : Int
Return number of elements in the buffer
override def prepend (elems : A*) : Unit
Prepend an element to this list.
def prependAll (elems : Iterable[A]) : Unit
Prepends a number of elements provided by an iterable object via its iterator method. The identity of the buffer is returned.
override def readOnly : Seq[A]
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
companion
Methods inherited from BufferLike
+:, remove, -=, ++:, ++:, appendAll, prependAll, prependAll, trimStart, trimEnd, stringPrefix, ++=, +, ++, ++, -, -, --, --
Methods inherited from Shrinkable
-=, --=, --=
Methods inherited from Growable
+=, ++=, ++=
Methods inherited from SeqLike
thisCollection, toCollection, lengthCompare, size, isDefinedAt, segmentLength, prefixLength, indexWhere, indexWhere, findIndexOf, indexOf, indexOf, lastIndexOf, lastIndexOf, lastIndexWhere, lastIndexWhere, reverse, reverseMap, reverseIterator, reversedElements, startsWith, startsWith, endsWith, indexOfSeq, indexOfSeq, lastIndexOfSeq, lastIndexOfSeq, contains, union, diff, intersect, removeDuplicates, patch, updated, +:, :+, padTo, sortWith, sortWith, sortBy, toSeq, indices, view, view, findLastIndexOf, equalsWith, containsSlice, projection
Methods inherited from PartialFunction
orElse, andThen
Methods inherited from Function1
compose
Methods inherited from IterableLike
elements, foreach, forall, exists, find, isEmpty, foldRight, reduceRight, toIterable, head, take, slice, takeWhile, takeRight, dropRight, copyToArray, zip, zipAll, zipWithIndex, sameElements, toStream, canEqual, first, firstOption
Methods inherited from GenericTraversableTemplate
newBuilder, genericBuilder, unzip, flatten, transpose
Methods inherited from TraversableLike
repr, nonEmpty, hasDefiniteSize, ++, ++, map, flatMap, filter, filterNot, partialMap, remove, partition, groupBy, count, foldLeft, /:, :\, reduceLeft, reduceLeftOption, reduceRightOption, sum, product, min, max, headOption, tail, last, lastOption, init, drop, dropWhile, span, splitAt, copyToBuffer, copyToArray, toArray, toList, toIndexedSeq, toSet, mkString, mkString, mkString, addString, addString, addString, withFilter
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
Return number of elements in the buffer

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

def apply(n : Int) : A
Return element at index `n`
Throws
IndexOutofBoundsException - if the index is not valid

@deprecated("Use += instead if you intend to add by side effect to an existing collection.\012".+("Use `clone() ++=' if you intend to create a new collection."))

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.

def +=(elem : A) : BufferProxy[A]
Append a single element to this buffer.
Parameters
elem - the element to append.

override def readOnly : Seq[A]

@deprecated("Use ++= instead if you intend to add by side effect to an existing collection.\012".+("Use `clone() ++=` if you intend to create a new collection."))

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

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

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

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

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.

override def ++=:(iter : Traversable[A]) : Buffer[A]
Prepends a number of elements provided by an iterable object via its iterator method. The identity of the buffer is returned.(repr /: elems) (_ plus _)
Parameters
iter - the iterable object.

override def ++=:(iter : Iterator[A]) : Buffer[A]
Prepends a number of elements provided by an iterator The identity of the buffer is returned.
Parameters
iter - the iterator
Returns
the updated buffer.

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

def prependAll(elems : Iterable[A]) : Unit
Prepends a number of elements provided by an iterable object via its iterator method. The identity of the buffer is returned.
Parameters
iter - the iterable 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.
Parameters
n - the index where a new element will be inserted.
elems - the new elements to 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.

override 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.
Parameters
n - the index where a new element will be inserted.
iter - the iterable object providing all elements to insert.
Throws
IndexOutofBoundsException - if the index is not valid

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.

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

def clear : Unit
Clears the buffer contents.

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

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