scala.collection

TraversableOnce

trait TraversableOnce [+A] extends AnyRef

A template trait for collections which can be traversed either once only or one or more times.

This trait is composed of those methods which can be implemented solely in terms of foreach and which do not need access to a Builder. It represents the implementations common to Iterators and Traversables, such as folds, conversions, and other operations which traverse some or all of the elements and return a derived value.

A

the element type of the collection

linear super types: AnyRef, Any
known subclasses: TraversableLike, Traversable, TraversableForwarder, IterableLike, Iterable, IterableForwarder, SeqLike, Seq, SeqForwarder, LinearSeqLike, LinearSeq, Traversable, Iterable, Seq, LinearSeq, Queue, IndexedSeqLike, Iterator, GroupedIterator, BufferedIterator, Elements, IndexedSeqOptimized, StringLike, StringOps, LinearSeqOptimized, Traversable, Iterable, Seq, LinearSeq, MutableList, Queue, IndexedSeqLike, IndexedSeqOptimized, IndexedSeq, IndexedSeq, StringBuilder, SynchronizedQueue, ArrayLike, WrappedArray, ArrayOps, ofUnit, ofBoolean, ofDouble, ofFloat, ofLong, ofInt, ofChar, ofShort, ofByte, ofRef, MapLike, DefaultValuesIterable, SetLike, Set, DefaultKeySet, MapLike, Map, Map, ListMap, HashMap, ResizableArray, BufferLike, Buffer, ArrayBuffer, Script, SetLike, Set, HashSet, ConcurrentMap, ObservableSet, TraversableViewLike, Transformed, TakenWhile, Filtered, Appended, FlatMapped, Mapped, Sliced, Forced, DroppedWhile, TraversableView, IterableViewLike, Transformed, Zipped, DroppedWhile, TakenWhile, Filtered, Appended, FlatMapped, Mapped, Sliced, Forced, ZippedAll, IterableView, SeqViewLike, Transformed, Patched, Reversed, ZippedAll, Zipped, DroppedWhile, TakenWhile, Filtered, Appended, FlatMapped, Mapped, Sliced, Forced, Prepended, SeqView, IndexedSeqView, Transformed, DroppedWhile, TakenWhile, Filtered, Sliced, Reversed, TraversableProxyLike, IterableProxyLike, SetProxyLike, SetProxy, LinkedListLike, DoubleLinkedListLike, JPropertiesWrapper, JDictionaryWrapper, JMapWrapperLike, JConcurrentMapWrapper, JMapWrapper, JSetWrapper, JListWrapper, JCollectionWrapper, JIterableWrapper, JEnumerationWrapper, JIteratorWrapper, WeakHashMap, DefaultMapModel, OpenHashMap, History, LinkedHashMap, ObservableBuffer, MapProxyLike, MapProxy, ObservableMap, MultiMap, PriorityQueue, SynchronizedMap, LinkedList, LinkedHashSet, SynchronizedPriorityQueue, Stack, SynchronizedStack, PriorityQueueProxy, ImmutableSetAdaptor, DoubleLinkedList, SynchronizedBuffer, RevertibleHistory, BufferProxy, QueueProxy, ArrayStack, ofUnit, ofBoolean, ofDouble, ofFloat, ofLong, ofInt, ofChar, ofShort, ofByte, ofRef, BitSetLike, BitSet, BitSet, List, ListBuffer, ImmutableMapAdaptor, StackProxy, ArraySeq, SynchronizedSet, IndexedSeq, Vector, MapLike, Map, IntMap, ::, ListMap, Node, SortedSetLike, SortedSet, Set, SortedSet, TreeSet, HashMap, HashTrieMap, HashMap1, HashSet, HashTrieSet, HashSet1, LongMap, NumericRange, Exclusive, Inclusive, Stream, Cons, Empty, SetProxy, SortedMapLike, DefaultKeySortedSet, SortedMap, SortedMap, Range, ByOne, Inclusive, Set4, Set3, Set2, Set1, EmptySet, MapProxy, WrappedString, VectorIterator, Nil, TreeMap, Impl, Map4, Map3, Map2, Map1, EmptyMap, WithDefault, PagedSeq, Stack, DefaultMap, BitSet, BitSetN, BitSet2, BitSet1, ListSet, Node, SetProxy, MapProxy, TraversableProxy, IterableProxy, SeqProxyLike, DefaultMap, SeqProxy, ValueSet, SelectionSet, columns, rows, BufferWrapper, pages, Content, RefBuffer, items, Indices, indices, AbsScope, Source, LineIterator, BufferedSource, UnPicklerEnv, PicklerEnv, Scope, MatchIterator, NodeSeq, Node, ProducerConsumerIterator, XMLEventReader, Elem, SpecialNode, Atom, Unparsed, Group, MetaData, Attribute, PrefixedAttribute, Text, EntityRef, Document, Comment, ProcInstr, PCData, Null, NodeBuffer, UnprefixedAttribute, CountedIterator, EmptySet, EmptyMap
self type: TraversableOnce[A]
source: TraversableOnce.scala
    version
  1. 2.8

    since
  1. 2.8

Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. TraversableOnce
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All
Impl.
  1. Concrete
  2. Abstract

Value Members

  1. def != (arg0: AnyRef) : Boolean

    attributes: final
    definition classes: AnyRef
  2. def != (arg0: Any) : Boolean

    o != arg0 is the same as !(o == (arg0)).

    o != arg0 is the same as !(o == (arg0)).

    arg0

    the object to compare against this object for dis-equality.

    returns

    false if the receiver object is equivalent to the argument; true otherwise.

    attributes: final
    definition classes: Any
  3. def ## () : Int

    attributes: final
    definition classes: AnyRef → Any
  4. def $asInstanceOf [T0] () : T0

    attributes: final
    definition classes: AnyRef
  5. def $isInstanceOf [T0] () : Boolean

    attributes: final
    definition classes: AnyRef
  6. def /: [B] (z: B)(op: (B, A) ⇒ B) : B

    Applies a binary operator to a start value and all elements of this traversable or iterator, going left to right.

    Applies a binary operator to a start value and all elements of this traversable or iterator, going left to right.

    Note: /: is alternate syntax for foldLeft; z /: xs is the same as xs foldLeft z.

    Note: will not terminate for infinite-sized collections.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    z

    the start value.

    op

    the binary operator.

    returns

    the result of inserting op between consecutive elements of this traversable or iterator, going left to right with the start value z on the left: op(...op(op(z, x1), x2), ..., xn) where x,,1,,, ..., x,,n,, are the elements of this traversable or iterator.

  7. def :\ [B] (z: B)(op: (A, B) ⇒ B) : B

    Applies a binary operator to all elements of this traversable or iterator and a start value, going right to left.

    Applies a binary operator to all elements of this traversable or iterator and a start value, going right to left.

    Note: :\ is alternate syntax for foldRight; xs :\ z is the same as xs foldRight z.

    Note: will not terminate for infinite-sized collections.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    z

    the start value

    op

    the binary operator

    returns

    the result of inserting op between consecutive elements of this traversable or iterator, going right to left with the start value z on the right: op(x1, op(x2, ... op(xn, z)...)) where x,,1,,, ..., x,,n,, are the elements of this traversable or iterator.

  8. def == (arg0: AnyRef) : Boolean

    o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

    o == arg0 is the same as if (o eq null) arg0 eq null else o.equals(arg0).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    attributes: final
    definition classes: AnyRef
  9. def == (arg0: Any) : Boolean

    o == arg0 is the same as o.equals(arg0).

    o == arg0 is the same as o.equals(arg0).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    attributes: final
    definition classes: Any
  10. def addString (b: StringBuilder) : StringBuilder

    Appends all elements of this traversable or iterator to a string builder.

    Appends all elements of this traversable or iterator to a string builder. The written text consists of the string representations (w.r.t. the method toString) of all elements of this traversable or iterator without any separator string.

    b

    the string builder to which elements are appended.

    returns

    the string builder b to which elements were appended.

  11. def addString (b: StringBuilder, sep: String) : StringBuilder

    Appends all elements of this traversable or iterator to a string builder using a separator string.

    Appends all elements of this traversable or iterator to a string builder using a separator string. The written text consists of the string representations (w.r.t. the method toString) of all elements of this traversable or iterator, separated by the string sep.

    b

    the string builder to which elements are appended.

    sep

    the separator string.

    returns

    the string builder b to which elements were appended.

  12. def addString (b: StringBuilder, start: String, sep: String, end: String) : StringBuilder

    Appends all elements of this traversable or iterator to a string builder using start, end, and separator strings.

    Appends all elements of this traversable or iterator to a string builder using start, end, and separator strings. The written text begins with the string start and ends with the string end. Inside, the string representations (w.r.t. the method toString) of all elements of this traversable or iterator are separated by the string sep.

    b

    the string builder to which elements are appended.

    start

    the starting string.

    sep

    the separator string.

    end

    the ending string.

    returns

    the string builder b to which elements were appended.

  13. def asInstanceOf [T0] : T0

    This method is used to cast the receiver object to be of type T0.

    This method is used to cast the receiver object to be of type T0.

    Note that the success of a cast at runtime is modulo Scala's erasure semantics. Therefore the expression1.asInstanceOf[String] will throw a ClassCastException at runtime, while the expressionList(1).asInstanceOf[List[String]] will not. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested typed.

    returns

    the receiver object.

    attributes: final
    definition classes: Any
  14. def clone () : AnyRef

    This method creates and returns a copy of the receiver object.

    This method creates and returns a copy of the receiver object.

    The default implementation of the clone method is platform dependent.

    returns

    a copy of the receiver object.

    attributes: protected
    definition classes: AnyRef
  15. def copyToArray (xs: Array[A]) : Unit

    [use case] Copies values of this traversable or iterator to an array.

    [use case]

    Copies values of this traversable or iterator to an array. Fills the given array xs with values of this traversable or iterator. Copying will stop once either the end of the current traversable or iterator is reached, or the end of the array is reached.

    xs

    the array to fill.

    attributes: abstract
  16. def copyToArray [B >: A] (xs: Array[B]) : Unit

    Copies values of this traversable or iterator to an array.

    Copies values of this traversable or iterator to an array. Fills the given array xs with values of this traversable or iterator. Copying will stop once either the end of the current traversable or iterator is reached, or the end of the array is reached.

    Note: will not terminate for infinite-sized collections.

    B

    the type of the elements of the array.

    xs

    the array to fill.

  17. def copyToArray (xs: Array[A], start: Int) : Unit

    [use case] Copies values of this traversable or iterator to an array.

    [use case]

    Copies values of this traversable or iterator to an array. Fills the given array xs with values of this traversable or iterator, after skipping start values. Copying will stop once either the end of the current traversable or iterator is reached, or the end of the array is reached.

    xs

    the array to fill.

    start

    the starting index.

    attributes: abstract
  18. def copyToArray [B >: A] (xs: Array[B], start: Int) : Unit

    Copies values of this traversable or iterator to an array.

    Copies values of this traversable or iterator to an array. Fills the given array xs with values of this traversable or iterator, after skipping start values. Copying will stop once either the end of the current traversable or iterator is reached, or the end of the array is reached.

    Note: will not terminate for infinite-sized collections.

    B

    the type of the elements of the array.

    xs

    the array to fill.

    start

    the starting index.

  19. def copyToArray [B >: A] (xs: Array[B], start: Int, len: Int) : Unit

    attributes: abstract
  20. def copyToBuffer [B >: A] (dest: Buffer[B]) : Unit

    Copies all elements of this traversable or iterator to a buffer.

    Copies all elements of this traversable or iterator to a buffer.

    Note: will not terminate for infinite-sized collections.

    dest

    The buffer to which elements are copied.

  21. def count (p: (A) ⇒ Boolean) : Int

    Counts the number of elements in the traversable or iterator which satisfy a predicate.

    Counts the number of elements in the traversable or iterator which satisfy a predicate.

    p

    the predicate used to test elements.

    returns

    the number of elements satisfying the predicate p.

  22. def eq (arg0: AnyRef) : Boolean

    This method is used to test whether the argument (arg0) is a reference to the receiver object (this).

    This method is used to test whether the argument (arg0) is a reference to the receiver object (this).

    The eq method implements an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation] on non-null instances of AnyRef: * It is reflexive: for any non-null instance x of type AnyRef, x.eq(x) returns true. * It is symmetric: for any non-null instances x and y of type AnyRef, x.eq(y) returns true if and only if y.eq(x) returns true. * It is transitive: for any non-null instances x, y, and z of type AnyRef if x.eq(y) returns true and y.eq(z) returns true, then x.eq(z) returns true.

    Additionally, the eq method has three other properties. * It is consistent: for any non-null instances x and y of type AnyRef, multiple invocations of x.eq(y) consistently returns true or consistently returns false. * For any non-null instance x of type AnyRef, x.eq(null) and null.eq(x) returns false. * null.eq(null) returns true.

    When overriding the equals or hashCode methods, it is important to ensure that their behavior is consistent with reference equality. Therefore, if two objects are references to each other (o1 eq o2), they should be equal to each other (o1 == o2) and they should hash to the same value (o1.hashCode == o2.hashCode).

    arg0

    the object to compare against this object for reference equality.

    returns

    true if the argument is a reference to the receiver object; false otherwise.

    attributes: final
    definition classes: AnyRef
  23. def equals (arg0: Any) : Boolean

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    This method is used to compare the receiver object (this) with the argument object (arg0) for equivalence.

    The default implementations of this method is an [http://en.wikipedia.org/wiki/Equivalence_relation equivalence relation]: * It is reflexive: for any instance x of type Any, x.equals(x) should return true. * It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true. * It is transitive: for any instances x, y, and z of type AnyRef if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

    If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is often necessary to override hashCode to ensure that objects that are "equal" (o1.equals(o2) returns true) hash to the same scala.Int (o1.hashCode.equals(o2.hashCode)).

    arg0

    the object to compare against this object for equality.

    returns

    true if the receiver object is equivalent to the argument; false otherwise.

    definition classes: AnyRef → Any
  24. def exists (p: (A) ⇒ Boolean) : Boolean

    attributes: abstract
  25. def finalize () : Unit

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object.

    This method is called by the garbage collector on the receiver object when garbage collection determines that there are no more references to the object.

    The details of when and if the finalize method are invoked, as well as the interaction between finalizeand non-local returns and exceptions, are all platform dependent.

    attributes: protected
    definition classes: AnyRef
  26. def find (p: (A) ⇒ Boolean) : Option[A]

    attributes: abstract
  27. def foldLeft [B] (z: B)(op: (B, A) ⇒ B) : B

    Applies a binary operator to a start value and all elements of this traversable or iterator, going left to right.

    Applies a binary operator to a start value and all elements of this traversable or iterator, going left to right.

    Note: will not terminate for infinite-sized collections.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    z

    the start value.

    op

    the binary operator.

    returns

    the result of inserting op between consecutive elements of this traversable or iterator, going left to right with the start value z on the left: op(...op(z, x1), x2, ..., xn) where x,,1,,, ..., x,,n,, are the elements of this traversable or iterator.

  28. def foldRight [B] (z: B)(op: (A, B) ⇒ B) : B

    Applies a binary operator to all elements of this traversable or iterator and a start value, going right to left.

    Applies a binary operator to all elements of this traversable or iterator and a start value, going right to left.

    Note: will not terminate for infinite-sized collections.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    z

    the start value.

    op

    the binary operator.

    returns

    the result of inserting op between consecutive elements of this traversable or iterator, going right to left with the start value z on the right: op(x1, op(x2, ... op(xn, z)...)) where x,,1,,, ..., x,,n,, are the elements of this traversable or iterator.

  29. def forall (p: (A) ⇒ Boolean) : Boolean

    Presently these are abstract because the Traversable versions use breakable/break, and I wasn't sure enough of how that's supposed to function to consolidate them with the Iterator versions.

    Presently these are abstract because the Traversable versions use breakable/break, and I wasn't sure enough of how that's supposed to function to consolidate them with the Iterator versions.

    attributes: abstract
  30. def foreach [U] (f: (A) ⇒ U) : Unit

    Self-documenting abstract methods.

    Self-documenting abstract methods.

    attributes: abstract
  31. def getClass () : java.lang.Class[_ <: java.lang.Object]

    Returns a representation that corresponds to the dynamic class of the receiver object.

    Returns a representation that corresponds to the dynamic class of the receiver object.

    The nature of the representation is platform dependent.

    returns

    a representation that corresponds to the dynamic class of the receiver object.

    attributes: final
    definition classes: AnyRef
  32. def hasDefiniteSize : Boolean

    attributes: abstract
  33. def hashCode () : Int

    Returns a hash code value for the object.

    Returns a hash code value for the object.

    The default hashing algorithm is platform dependent.

    Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

    returns

    the hash code value for the object.

    definition classes: AnyRef → Any
  34. def isEmpty : Boolean

    attributes: abstract
  35. def isInstanceOf [T0] : Boolean

    This method is used to test whether the dynamic type of the receiver object is T0.

    This method is used to test whether the dynamic type of the receiver object is T0.

    Note that the test result of the test is modulo Scala's erasure semantics. Therefore the expression1.isInstanceOf[String] will return false, while the expression List(1).isInstanceOf[List[String]] will return true. In the latter example, because the type argument is erased as part of compilation it is not possible to check whether the contents of the list are of the requested typed.

    returns

    true if the receiver object is an instance of erasure of type T0; false otherwise.

    attributes: final
    definition classes: Any
  36. def isTraversableAgain : Boolean

    Tests whether this traversable or iterator can be repeatedly traversed.

    Tests whether this traversable or iterator can be repeatedly traversed. Always true for Traversables and false for Iterators unless overridden.

    returns

    true if it is repeatedly traversable, false otherwise.

    attributes: abstract
  37. def max : A

    [use case] Finds the largest element.

    [use case]

    Finds the largest element.

    returns

    the largest element of this traversable or iterator.

    attributes: abstract
  38. def max [B >: A] (implicit cmp: Ordering[B]) : A

    Finds the largest element.

    Finds the largest element.

    B

    The type over which the ordering is defined.

    cmp

    An ordering to be used for comparing elements.

    returns

    the largest element of this traversable or iterator with respect to the ordering cmp.

  39. def min : A

    [use case] Finds the smallest element.

    [use case]

    Finds the smallest element.

    returns

    the smallest element of this traversable or iterator

    attributes: abstract
  40. def min [B >: A] (implicit cmp: Ordering[B]) : A

    Finds the smallest element.

    Finds the smallest element.

    B

    The type over which the ordering is defined.

    cmp

    An ordering to be used for comparing elements.

    returns

    the smallest element of this traversable or iterator with respect to the ordering cmp.

  41. def mkString : String

    Displays all elements of this traversable or iterator in a string.

    Displays all elements of this traversable or iterator in a string.

    returns

    a string representation of this traversable or iterator. In the resulting string the string representations (w.r.t. the method toString) of all elements of this traversable or iterator follow each other without any separator string.

  42. def mkString (sep: String) : String

    Displays all elements of this traversable or iterator in a string using a separator string.

    Displays all elements of this traversable or iterator in a string using a separator string.

    sep

    the separator string.

    returns

    a string representation of this traversable or iterator. In the resulting string the string representations (w.r.t. the method toString) of all elements of this traversable or iterator are separated by the string sep.

  43. def mkString (start: String, sep: String, end: String) : String

    Displays all elements of this traversable or iterator in a string using start, end, and separator strings.

    Displays all elements of this traversable or iterator in a string using start, end, and separator strings.

    start

    the starting string.

    sep

    the separator string.

    end

    the ending string.

    returns

    a string representation of this traversable or iterator. The resulting string begins with the string start and ends with the string end. Inside, the string representations (w.r.t. the method toString) of all elements of this traversable or iterator are separated by the string sep.

  44. def ne (arg0: AnyRef) : Boolean

    o.ne(arg0) is the same as !(o.eq(arg0)).

    o.ne(arg0) is the same as !(o.eq(arg0)).

    arg0

    the object to compare against this object for reference dis-equality.

    returns

    false if the argument is not a reference to the receiver object; true otherwise.

    attributes: final
    definition classes: AnyRef
  45. def nonEmpty : Boolean

    Tests whether the traversable or iterator is not empty.

    Tests whether the traversable or iterator is not empty.

    returns

    true if the traversable or iterator contains at least one element, false otherwise.

  46. def notify () : Unit

    Wakes up a single thread that is waiting on the receiver object's monitor.

    Wakes up a single thread that is waiting on the receiver object's monitor.

    attributes: final
    definition classes: AnyRef
  47. def notifyAll () : Unit

    Wakes up all threads that are waiting on the receiver object's monitor.

    Wakes up all threads that are waiting on the receiver object's monitor.

    attributes: final
    definition classes: AnyRef
  48. def product : A

    [use case] Multiplies up the elements of this collection.

    [use case]

    Multiplies up the elements of this collection.

    returns

    the product of all elements in this traversable or iterator of numbers of type Int. Instead of Int, any other type T with an implicit Numeric[T] implementation can be used as element type of the traversable or iterator and as result type of product. Examples of such types are: Long, Float, Double, BigInt.

    attributes: abstract
  49. def product [B >: A] (implicit num: Numeric[B]) : B

    Multiplies up the elements of this collection.

    Multiplies up the elements of this collection.

    B

    the result type of the * operator.

    num

    an implicit parameter defining a set of numeric operations which includes the * operator to be used in forming the product.

    returns

    the product of all elements of this traversable or iterator with respect to the * operator in num.

  50. def reduceLeft [B >: A] (op: (B, A) ⇒ B) : B

    Applies a binary operator to all elements of this traversable or iterator, going left to right.

    Applies a binary operator to all elements of this traversable or iterator, going left to right.

    Note: will not terminate for infinite-sized collections.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    op

    the binary operator.

    returns

    the result of inserting op between consecutive elements of this traversable or iterator, going left to right: op(...(op(x1, x2), ... ) , xn) where x,,1,,, ..., x,,n,, are the elements of this traversable or iterator.

  51. def reduceLeftOption [B >: A] (op: (B, A) ⇒ B) : Option[B]

    Optionally applies a binary operator to all elements of this traversable or iterator, going left to right.

    Optionally applies a binary operator to all elements of this traversable or iterator, going left to right.

    Note: will not terminate for infinite-sized collections.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    op

    the binary operator.

    returns

    an option value containing the result of reduceLeft(op) is this traversable or iterator is nonempty, None otherwise.

  52. def reduceRight [B >: A] (op: (A, B) ⇒ B) : B

    Applies a binary operator to all elements of this traversable or iterator, going right to left.

    Applies a binary operator to all elements of this traversable or iterator, going right to left.

    Note: will not terminate for infinite-sized collections.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    op

    the binary operator.

    returns

    the result of inserting op between consecutive elements of this traversable or iterator, going right to left: op(x1, op(x2, ..., op(xn-1, xn)...)) where x,,1,,, ..., x,,n,, are the elements of this traversable or iterator.

  53. def reduceRightOption [B >: A] (op: (A, B) ⇒ B) : Option[B]

    Optionally applies a binary operator to all elements of this traversable or iterator, going right to left.

    Optionally applies a binary operator to all elements of this traversable or iterator, going right to left.

    Note: will not terminate for infinite-sized collections.

    Note: might return different results for different runs, unless the underlying collection type is ordered or the operator is associative and commutative.

    B

    the result type of the binary operator.

    op

    the binary operator.

    returns

    an option value containing the result of reduceRight(op) is this traversable or iterator is nonempty, None otherwise.

  54. def reversed : List[A]

    attributes: protected[this]
  55. def size : Int

    The size of this traversable or iterator.

    The size of this traversable or iterator.

    Note: will not terminate for infinite-sized collections.

    returns

    the number of elements in this traversable or iterator.

  56. def sum : A

    [use case] Sums up the elements of this collection.

    [use case]

    Sums up the elements of this collection.

    returns

    the sum of all elements in this traversable or iterator of numbers of type Int. Instead of Int, any other type T with an implicit Numeric[T] implementation can be used as element type of the traversable or iterator and as result type of sum. Examples of such types are: Long, Float, Double, BigInt.

    attributes: abstract
  57. def sum [B >: A] (implicit num: Numeric[B]) : B

    Sums up the elements of this collection.

    Sums up the elements of this collection.

    B

    the result type of the + operator.

    num

    an implicit parameter defining a set of numeric operations which includes the + operator to be used in forming the sum.

    returns

    the sum of all elements of this traversable or iterator with respect to the + operator in num.

  58. def synchronized [T0] (arg0: T0) : T0

    attributes: final
    definition classes: AnyRef
  59. def toArray : Array[A]

    [use case] Converts this traversable or iterator to an array.

    [use case]

    Converts this traversable or iterator to an array.

    Note: will not terminate for infinite-sized collections.

    returns

    an array containing all elements of this traversable or iterator. A ClassManifest must be available for the element type of this traversable or iterator.

    attributes: abstract
  60. def toArray [B >: A] (implicit arg0: ClassManifest[B]) : Array[B]

    Converts this traversable or iterator to an array.

    Converts this traversable or iterator to an array.

    Note: will not terminate for infinite-sized collections.

    B

    the type of the elements of the array. A ClassManifest for this type must be available.

    returns

    an array containing all elements of this traversable or iterator.

  61. def toBuffer [B >: A] : Buffer[B]

    Converts this traversable or iterator to a mutable buffer.

    Converts this traversable or iterator to a mutable buffer.

    Note: will not terminate for infinite-sized collections.

    returns

    a buffer containing all elements of this traversable or iterator.

  62. def toIndexedSeq [B >: A] : IndexedSeq[B]

    Converts this traversable or iterator to an indexed sequence.

    Converts this traversable or iterator to an indexed sequence.

    Note: will not terminate for infinite-sized collections.

    returns

    an indexed sequence containing all elements of this traversable or iterator.

  63. def toIterable : Iterable[A]

    Converts this traversable or iterator to an iterable collection.

    Converts this traversable or iterator to an iterable collection. Note that the choice of target Iterable is lazy in this default implementation as this TraversableOnce may be lazy and unevaluated (i.e. it may be an iterator which is only traversable once).

    Note: will not terminate for infinite-sized collections.

    returns

    an Iterable containing all elements of this traversable or iterator.

  64. def toIterator : Iterator[A]

    Returns an Iterator over the elements in this traversable or iterator.

    Returns an Iterator over the elements in this traversable or iterator. Will return the same Iterator if this instance is already an Iterator.

    Note: will not terminate for infinite-sized collections.

    returns

    an Iterator containing all elements of this traversable or iterator.

    attributes: abstract
  65. def toList : List[A]

    Converts this traversable or iterator to a list.

    Converts this traversable or iterator to a list.

    Note: will not terminate for infinite-sized collections.

    returns

    a list containing all elements of this traversable or iterator.

  66. def toMap [T, U] (implicit ev: <:<[A, (T, U)]) : Map[T, U]

    Converts this traversable or iterator to a map.

    Converts this traversable or iterator to a map. This method is unavailable unless the elements are members of Tuple2, each ((K, V)) becoming a key-value pair in the map. Duplicate keys will be overwritten by later keys: if this is an unordered collection, which key is in the resulting map is undefined.

    Note: will not terminate for infinite-sized collections.

    returns

    a map containing all elements of this traversable or iterator.

  67. def toSeq : Seq[A]

    Converts this traversable or iterator to a sequence.

    Converts this traversable or iterator to a sequence. As with toIterable, it's lazy in this default implementation, as this TraversableOnce may be lazy and unevaluated.

    Note: will not terminate for infinite-sized collections.

    returns

    a sequence containing all elements of this traversable or iterator.

  68. def toSet [B >: A] : Set[B]

    Converts this traversable or iterator to a set.

    Converts this traversable or iterator to a set.

    Note: will not terminate for infinite-sized collections.

    returns

    a set containing all elements of this traversable or iterator.

  69. def toStream : Stream[A]

    Converts this traversable or iterator to a stream.

    Converts this traversable or iterator to a stream.

    Note: will not terminate for infinite-sized collections.

    returns

    a stream containing all elements of this traversable or iterator.

    attributes: abstract
  70. def toString () : String

    Returns a string representation of the object.

    Returns a string representation of the object.

    The default representation is platform dependent.

    returns

    a string representation of the object.

    definition classes: AnyRef → Any
  71. def toTraversable : Traversable[A]

    Converts this traversable or iterator to an unspecified Traversable.

    Converts this traversable or iterator to an unspecified Traversable. Will return the same collection if this instance is already Traversable.

    Note: will not terminate for infinite-sized collections.

    returns

    a Traversable containing all elements of this traversable or iterator.

    attributes: abstract
  72. def wait () : Unit

    attributes: final
    definition classes: AnyRef
  73. def wait (arg0: Long, arg1: Int) : Unit

    attributes: final
    definition classes: AnyRef
  74. def wait (arg0: Long) : Unit

    attributes: final
    definition classes: AnyRef

Inherited from AnyRef

Inherited from Any