scala

trait Collection

[source: scala/Collection.scala]

trait Collection[+A]
extends Iterable[A]
Variant of Iterable used to describe collections with a finite number of elements. Basically, this trait just adds size and toString to Iterable, as most of the methods in Iterable already assume finite-ness.
Author
Sean McDirmid
Direct Known Subclasses:
CollectionProxy, Seq, Map, Set, MutableIterable, History, MetaData

Method Summary
abstract def size : Int
Returns the number of elements in this collection.
protected def stringPrefix : java.lang.String
Defines the prefix of this object's toString representation.
def toArray [B >: A] : Array[B]
Converts this iterable to a fresh Array with elements.
override def toString : java.lang.String
Methods inherited from Iterable
elements (abstract), concat, ++, map, flatMap, filter, partition, takeWhile, dropWhile, take, drop, foreach, forall, exists, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, copyToBuffer, sameElements, toList, toStream, mkString, mkString, mkString, addString, addString, copyToArray, isEmpty, projection, hasDefiniteSize
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
abstract def size : Int
Returns the number of elements in this collection.
Returns
number of collection elements.

def toArray[B >: A] : Array[B]
Converts this iterable to a fresh Array with elements.

override def toString : java.lang.String

protected def stringPrefix : java.lang.String
Defines the prefix of this object's toString representation.