scala.collection.generic

trait Addable

[source: scala/collection/generic/Addable.scala]

trait Addable[A, +This <: Addable[A, This]]
extends AnyRef
This class represents collections that can be added to other collections using a '+' operator.
Author
Martin Odersky
Owner
Martin Odersky
Version
2.8
Since
2.8
Direct Known Subclasses:
SetLike, BufferLike, PriorityQueue

Method Summary
def + (elem1 : A, elem2 : A, elems : A*) : This
Adds two or more elements to this collection and returns a new collection.
abstract def + (elem : A) : This
Creates a new collection with an additional element, unless the element is already present.
def ++ (elems : Traversable[A]) : This
Adds a number of elements provided by a traversable object and returns a new collection with the added elements.
def ++ (iter : Iterator[A]) : This
Adds a number of elements provided by an iterator and returns a new collection with the added elements.
protected abstract def repr : This
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
protected abstract def repr : This

abstract def +(elem : A) : This
Creates a new collection with an additional element, unless the element is already present.
Parameters
elem - the element to be added
Returns
a fresh collection

def +(elem1 : A, elem2 : A, elems : A*) : This
Adds two or more elements to this collection and returns a new collection.
Parameters
elem1 - the first element to add.
elem2 - the second element to add.
elems - the remaining elements to add.

def ++(elems : Traversable[A]) : This
Adds a number of elements provided by a traversable object and returns a new collection with the added elements.
Parameters
elems - the traversable object.

def ++(iter : Iterator[A]) : This
Adds a number of elements provided by an iterator and returns a new collection with the added elements.
Parameters
iter - the iterator