scala.collection

trait TraversableLike

[source: scala/collection/TraversableLike.scala]

trait TraversableLike[+A, +Repr]
extends HasNewBuilder[A, Repr] with AnyRef

A template trait for traversable collections. This is a base trait of all kinds of Scala collections. It implements the behavior common to all collections, in terms of a method foreach with signature:

   def foreach[U](f: Elem => U): Unit

Collection classes mixing in this trait provide a concrete foreach method which traverses all the elements contained in the collection, applying a given function to each. They also need to provide a method newBuilder which creates a builder for collections of the same kind.

A traversable class might or might not have two properties: strictness and orderedness. Neither is represented as a type.

The instances of a strict collection class have all their elements computed before they can be used as values. By contrast, instances of a non-strict collection class may defer computation of some of their elements until after the instance is available as a value. A typical example of a non-strict collection class is a scala.collection.immutable.Stream. A more general class of examples are TraversableViews.

If a collection is an instance of an ordered collection class, traversing its elements with foreach will always visit elements in the same order, even for different runs of the program. If the class is not ordered, foreach can visit elements in different orders for different runs (but it will keep the same order in the same run).
A typical example of a collection class which is not ordered is a HashMap of objects. The traversal order for hash maps will depend on the hash codes of its elements, and these hash codes might differ from one run to the next. By contrast, a LinkedHashMap is odered because it's foreach method visits elements in the order they were inserted into the HashMap.

Author
Martin Odersky
Version
2.8
Since
2.8
Direct Known Subclasses:
IterableLike, Traversable, TraversableProxyLike, TraversableViewLike, Traversable, Traversable

Type Summary
protected type Self
The type implementing this traversable
Method Summary
def ++ [B >: A, That](that : Iterator[B])(implicit bf : CanBuildFrom[Repr, B, That]) : That
Creates a new traversable of type `That` which contains all elements of this traversable followed by all elements of an iterator.
def ++ [B >: A, That](that : Traversable[B])(implicit bf : CanBuildFrom[Repr, B, That]) : That
Creates a new traversable of type `That` which contains all elements of this traversable followed by all elements of another traversable.
def /: [B](z : B)(op : (B, A) => B) : B
Similar to foldLeft but can be used as an operator with the order of traversable and zero arguments reversed. That is, z /: xs is the same as xs foldLeft z
def :\ [B](z : B)(op : (A, B) => B) : B
An alias for foldRight. That is, xs :\ z is the same as xs foldRight z
def addString (b : StringBuilder, sep : java.lang.String) : StringBuilder
Write all elements of this string into given string builder. The string representations of elements (w.r.t. the method toString()) are separated by the string sep.
def addString (b : StringBuilder, start : java.lang.String, sep : java.lang.String, end : java.lang.String) : StringBuilder
Write all elements of this traversable into given string builder. The written text begins with the string start and is finished by the string end. Inside, the string representations of elements (w.r.t. the method toString()) are separated by the string sep.
def addString (b : StringBuilder) : StringBuilder
Write all elements of this string into given string builder without using any separator between consecutive elements.
def copyToArray [B >: A](xs : Array[B], start : Int) : Unit
Fills the given array xs with the elements of this traversable starting at position start until either the end of the current traversable or the end of array `xs` is reached.
def copyToArray [B >: A](xs : Array[B], start : Int, len : Int) : Unit
Fills the given array xs with at most `len` elements of this traversable starting at position `start`. Copying will stop once either the end of the current traversable is reached or `len` elements have been copied or the end of the array is reached.
def copyToBuffer [B >: A](dest : Buffer[B]) : Unit
Copy all elements of this traversable to a given buffer
def count (p : (A) => Boolean) : Int
Count the number of elements in the traversable which satisfy a predicate.
def drop (n : Int) : Repr
Returns this traversable without its n first elements If this traversable has less than n elements, the empty traversable is returned.
def dropWhile (p : (A) => Boolean) : Repr
Returns the longest suffix of this traversable whose first element does not satisfy the predicate p.
def exists (p : (A) => Boolean) : Boolean
Return true iff there is an element in this traversable for which the given predicate `p` yields true.
def filter (p : (A) => Boolean) : Repr
Returns all the elements of this traversable that satisfy the predicate p. The order of the elements is preserved.
def filterNot (p : (A) => Boolean) : Repr
Returns a traversable with all elements of this traversable which do not satisfy the predicate p.
def find (p : (A) => Boolean) : Option[A]
Find and return the first element of the traversable object satisfying a predicate, if any.
def flatMap [B, That](f : (A) => Traversable[B])(implicit bf : CanBuildFrom[Repr, B, That]) : That
Applies the given function f to each element of this traversable, then concatenates the results in a traversable of type That.
def foldLeft [B](z : B)(op : (B, A) => B) : B
Combines the elements of this traversable object together using the binary function f, from left to right, and starting with the value z.
def foldRight [B](z : B)(op : (A, B) => B) : B
Combines the elements of this traversable together using the binary function f, from right to left, and starting with the value z.
def forall (p : (A) => Boolean) : Boolean
Return true iff the given predicate `p` yields true for all elements of this traversable.
abstract def foreach [U](f : (A) => U) : Unit
Apply a function f to all elements of this traversable object.
def groupBy [K](f : (A) => K) : Map[K, Repr]
Partition this traversable into a map of traversables according to some discriminator function. @invariant (xs partition f)(k) = xs filter (x => f(x) == k)
def hasDefiniteSize : Boolean
Returns true if this collection is known to have finite size. This is the case if the collection type is strict, or if the collection type is non-strict (e.g. it's a Stream), but all collection elements have been computed. Many methods in this trait will not work on collections of infinite sizes.
def head : A
The first element of this traversable.
def headOption : Option[A]
Returns as an option the first element of this traversable or None if traversable is empty.
def init : Repr
a traversable consisting of all elements of this traversable except the last one.
def isEmpty : Boolean
Does this collection contain no elements?
def last : A
The last element of this traversable.
def lastOption : Option[A]
Returns as an option the last element of this traversable or None if traversable is empty.
def map [B, That](f : (A) => B)(implicit bf : CanBuildFrom[Repr, B, That]) : That
Returns the traversable that results from applying the given function f to each element of this traversable and collecting the results in a traversable of type `That`.
def max [B >: A](implicit cmp : Ordering[B]) : A
Returns the maximal element with respect to the given ordering `cmp`
def min [B >: A](implicit cmp : Ordering[B]) : A
Returns the minimal element with respect to the given ordering `cmp`
def mkString (sep : java.lang.String) : java.lang.String
Returns a string representation of this traversable object. The string representations of elements (w.r.t. the method toString()) are separated by the string sep.
def mkString (start : java.lang.String, sep : java.lang.String, end : java.lang.String) : java.lang.String
Returns a string representation of this traversable object. The resulting string begins with the string start and is finished by the string end. Inside, the string representations of elements (w.r.t. the method toString()) are separated by the string sep.
def mkString : java.lang.String
Returns a string representation of this traversable object. The string representations of elements (w.r.t. the method toString()) follow each other without any separator string.
protected[this] abstract def newBuilder : Builder[A, Repr]
Create a new builder for this collection type.
def nonEmpty : Boolean
Does this collection contain some elements?
def partialMap [B, That](pf : PartialFunction[Any, B])(implicit bf : CanBuildFrom[Repr, B, That]) : That
Returns a new traversable based on the partial function pf, containing pf(x) for all the elements which are defined on pf. The order of the elements is preserved.
def partition (p : (A) => Boolean) : (Repr, Repr)
Partitions this traversable in two traversables according to a predicate.
def product [B >: A](implicit num : Numeric[B]) : B
Returns the product of all elements with respect to the numeric operations in `num`
def reduceLeft [B >: A](op : (B, A) => B) : B
Combines the elements of this traversable object together using the binary operator op, from left to right
def reduceLeftOption [B >: A](op : (B, A) => B) : Option[B]
Combines the elements of this traversable object together using the binary operator op, from left to right
def reduceRight [B >: A](op : (A, B) => B) : B
Combines the elements of this traversable object together using the binary operator op, from right to left
def reduceRightOption [B >: A](op : (A, B) => B) : Option[B]
Combines the elements of this traversable object together using the binary operator op, from right to left.
def remove (p : (A) => Boolean) : Repr
Returns a traversable with all elements of this traversable which do not satisfy the predicate p.
def repr : Repr
def size : Int
The number of elements in this collection
def slice (from : Int, until : Int) : Repr
A sub-traversable starting at index `from` and extending up to (but not including) index `until`.
def span (p : (A) => Boolean) : (Repr, Repr)
Returns a pair consisting of the longest prefix of the traversable whose elements all satisfy the given predicate, and the rest of the traversable.
def splitAt (n : Int) : (Repr, Repr)
Split the traversable at a given point and return the two parts thus created.
def stringPrefix : java.lang.String
Defines the prefix of this object's toString representation.
def sum [B >: A](implicit num : Numeric[B]) : B
Returns the sum of all elements with respect to the numeric operations in `num`
def tail : Repr
a traversable consisting of all elements of this traversable except the first one.
def take (n : Int) : Repr
Return a traversable consisting only of the first n elements of this traversable, or else the whole traversable, if it has less than n elements.
def takeWhile (p : (A) => Boolean) : Repr
Returns the longest prefix of this traversable whose elements satisfy the predicate p.
protected[this] def thisCollection : Traversable[A]
def toArray [B >: A](implicit evidence$1 : ClassManifest[B]) : Array[B]
Converts this traversable to a fresh Array containing all elements.
protected[this] def toCollection (repr : Repr) : Traversable[A]
def toIndexedSeq [B >: A] : IndexedSeq[B]
Returns a IndexedSeq with all elements in this traversable object.
def toIterable : Iterable[A]
Returns a traversable with all elements in this traversable object.
def toList : List[A]
Returns a list with all elements of this traversable object.
def toSeq : Seq[A]
Returns a sequence with all elements in this traversable object.
def toSet [B >: A] : Set[B]
Returns an immutable set with all unique elements in this traversable object.
def toStream : Stream[A]
Returns a stream with all elements in this traversable object.
override def toString : java.lang.String
Returns a string representation of the object.
def view (from : Int, until : Int) : TraversableView[A, Repr]
A sub-traversable starting at index `from` and extending up to (but not including) index `until`.
def view : TraversableView[A, Repr]
Creates a view of this traversable @see TraversableView
def withFilter (p : (A) => Boolean) : WithFilter
Methods inherited from AnyRef
getClass, hashCode, equals, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
class WithFilter (p : (A) => Boolean) extends AnyRef
Type Details
protected type Self
The type implementing this traversable

Method Details
def repr : Repr

protected[this] def thisCollection : Traversable[A]

protected[this] def toCollection(repr : Repr) : Traversable[A]

protected[this] abstract def newBuilder : Builder[A, Repr]
Create a new builder for this collection type.
Overrides
HasNewBuilder.newBuilder

abstract def foreach[U](f : (A) => U) : Unit
Apply a function f to all elements of this traversable object.
Parameters
f - A function that is applied for its side-effect to every element. The result (of arbitrary type U) of function `f` is discarded.
Notes
This method underlies the implementation of most other bulk operations. It's important to implement this method in an efficient way.

def isEmpty : Boolean
Does this collection contain no elements?

def nonEmpty : Boolean
Does this collection contain some elements?

def size : Int
The number of elements in this collection

def hasDefiniteSize : Boolean
Returns true if this collection is known to have finite size. This is the case if the collection type is strict, or if the collection type is non-strict (e.g. it's a Stream), but all collection elements have been computed. Many methods in this trait will not work on collections of infinite sizes.

def ++[B >: A, That](that : Traversable[B])(implicit bf : CanBuildFrom[Repr, B, That]) : That
Creates a new traversable of type `That` which contains all elements of this traversable followed by all elements of another traversable.
Parameters
that - The traversable to append

def ++[B >: A, That](that : Iterator[B])(implicit bf : CanBuildFrom[Repr, B, That]) : That
Creates a new traversable of type `That` which contains all elements of this traversable followed by all elements of an iterator.
Parameters
that - The iterator to append

def map[B, That](f : (A) => B)(implicit bf : CanBuildFrom[Repr, B, That]) : That
Returns the traversable that results from applying the given function f to each element of this traversable and collecting the results in a traversable of type `That`.
Parameters
f - function to apply to each element.

def flatMap[B, That](f : (A) => Traversable[B])(implicit bf : CanBuildFrom[Repr, B, That]) : That
Applies the given function f to each element of this traversable, then concatenates the results in a traversable of type That.
Parameters
f - the function to apply on each element.

def filter(p : (A) => Boolean) : Repr
Returns all the elements of this traversable that satisfy the predicate p. The order of the elements is preserved.
Parameters
p - the predicate used to filter the traversable.
Returns
the elements of this traversable satisfying p.

def filterNot(p : (A) => Boolean) : Repr
Returns a traversable with all elements of this traversable which do not satisfy the predicate p.
Parameters
p - the predicate used to test elements
Returns
the traversable without all elements that satisfy p

def partialMap[B, That](pf : PartialFunction[Any, B])(implicit bf : CanBuildFrom[Repr, B, That]) : That
Returns a new traversable based on the partial function pf, containing pf(x) for all the elements which are defined on pf. The order of the elements is preserved.
Parameters
pf - the partial function which filters and maps the traversable.
Returns
the new traversable.

@deprecated("use `filterNot' instead")

def remove(p : (A) => Boolean) : Repr
Returns a traversable with all elements of this traversable which do not satisfy the predicate p.
Parameters
p - the predicate used to test elements
Returns
the traversable without all elements that satisfy p

def partition(p : (A) => Boolean) : (Repr, Repr)
Partitions this traversable in two traversables according to a predicate.
Parameters
p - the predicate on which to partition
Returns
a pair of traversables: the traversable that satisfies the predicate p and the traversable that does not. The relative order of the elements in the resulting traversables is the same as in the original traversable.

def groupBy[K](f : (A) => K) : Map[K, Repr]
Partition this traversable into a map of traversables according to some discriminator function. @invariant (xs partition f)(k) = xs filter (x => f(x) == k)
Notes
This method is not re-implemented by views. This means when applied to a view it will always force the view and return a new collection.

def forall(p : (A) => Boolean) : Boolean
Return true iff the given predicate `p` yields true for all elements of this traversable.
Notes
May not terminate for infinite-sized collections.
Parameters
p - the predicate

def exists(p : (A) => Boolean) : Boolean
Return true iff there is an element in this traversable for which the given predicate `p` yields true.
Notes
May not terminate for infinite-sized collections.
Parameters
p - the predicate

def count(p : (A) => Boolean) : Int
Count the number of elements in the traversable which satisfy a predicate.
Notes
Will not terminate for infinite-sized collections.
Parameters
p - the predicate for which to count
Returns
the number of elements satisfying the predicate p.

def find(p : (A) => Boolean) : Option[A]
Find and return the first element of the traversable object satisfying a predicate, if any.
Notes
may not terminate for infinite-sized collections.
Might return different results for different runs, unless this traversable is ordered.
Parameters
p - the predicate
Returns
an option containing the first element in the traversable object satisfying p, or None if none exists.

def foldLeft[B](z : B)(op : (B, A) => B) : B
Combines the elements of this traversable object together using the binary function f, from left to right, and starting with the value z.
Notes
Will not terminate for infinite-sized collections.
Might return different results for different runs, unless this traversable is ordered, or the operator is associative and commutative.
Returns
f(... (f(f(z, a0), a1) ...), an) if the traversable is [a0, a1, ..., an].

def /:[B](z : B)(op : (B, A) => B) : B
Similar to foldLeft but can be used as an operator with the order of traversable and zero arguments reversed. That is, z /: xs is the same as xs foldLeft z
Notes
Will not terminate for infinite-sized collections.
Might return different results for different runs, unless this traversable is ordered, or the operator is associative and commutative.

def foldRight[B](z : B)(op : (A, B) => B) : B
Combines the elements of this traversable together using the binary function f, from right to left, and starting with the value z.
Notes
Will not terminate for infinite-sized collections.
Might return different results for different runs, unless this traversable is ordered, or the operator is associative and commutative.
Returns
f(a0, f(a1, f(..., f(an, z)...))) if the traversable is [a0, a1, ..., an].

def :\[B](z : B)(op : (A, B) => B) : B
An alias for foldRight. That is, xs :\ z is the same as xs foldRight z
Notes
Will not terminate for infinite-sized collections.
Might return different results for different runs, unless this traversable is ordered, or the operator is associative and commutative.

def reduceLeft[B >: A](op : (B, A) => B) : B
Combines the elements of this traversable object together using the binary operator op, from left to right
Notes
Will not terminate for infinite-sized collections.
Might return different results for different runs, unless this traversable is ordered, or the operator is associative and commutative.
Parameters
op - The operator to apply
Returns
op(... op(a0,a1), ..., an) if the traversable object has elements a0, a1, ..., an.
Throws
Predef.UnsupportedOperationException - if the traversable object is empty.

def reduceLeftOption[B >: A](op : (B, A) => B) : Option[B]
Combines the elements of this traversable object together using the binary operator op, from left to right
Notes
Will not terminate for infinite-sized collections.
Might return different results for different runs, unless this traversable is ordered, or the operator is associative and commutative.
Parameters
op - The operator to apply
Returns
If the traversable is non-empty, the result of the operations as an Option, otherwise None.

def reduceRight[B >: A](op : (A, B) => B) : B
Combines the elements of this traversable object together using the binary operator op, from right to left
Notes
Will not terminate for infinite-sized collections.
Might return different results for different runs, unless this traversable is ordered, or the operator is associative and commutative.
Parameters
op - The operator to apply
Returns
a0 op (... op (an-1 op an)...) if the traversable object has elements a0, a1, ..., an.
Throws
Predef.UnsupportedOperationException - if the iterator is empty.

def reduceRightOption[B >: A](op : (A, B) => B) : Option[B]
Combines the elements of this traversable object together using the binary operator op, from right to left.
Notes
Will not terminate for infinite-sized collections.
Might return different results for different runs, unless this traversable is ordered, or the operator is associative and commutative.
Parameters
op - The operator to apply
Returns
If the traversable is non-empty, the result of the operations as an Option, otherwise None.

def sum[B >: A](implicit num : Numeric[B]) : B
Returns the sum of all elements with respect to the numeric operations in `num`

def product[B >: A](implicit num : Numeric[B]) : B
Returns the product of all elements with respect to the numeric operations in `num`

def min[B >: A](implicit cmp : Ordering[B]) : A
Returns the minimal element with respect to the given ordering `cmp`

def max[B >: A](implicit cmp : Ordering[B]) : A
Returns the maximal element with respect to the given ordering `cmp`

def head : A
The first element of this traversable.
Notes
Might return different results for different runs, unless this traversable is ordered
Throws
Predef.NoSuchElementException - if the traversable is empty.

def headOption : Option[A]
Returns as an option the first element of this traversable or None if traversable is empty.
Notes
Might return different results for different runs, unless this traversable is ordered

def tail : Repr
a traversable consisting of all elements of this traversable except the first one.
Notes
Might return different results for different runs, unless this traversable is ordered

def last : A
The last element of this traversable.
Throws
Predef.NoSuchElementException - if the traversable is empty.
Notes
Might return different results for different runs, unless this traversable is ordered

def lastOption : Option[A]
Returns as an option the last element of this traversable or None if traversable is empty.
Returns
the last element as an option.
Notes
Might return different results for different runs, unless this traversable is ordered

def init : Repr
a traversable consisting of all elements of this traversable except the last one.
Throws
Predef.UnsupportedOperationException - if the stream is empty.
Notes
Might return different results for different runs, unless this traversable is ordered

def take(n : Int) : Repr
Return a traversable consisting only of the first n elements of this traversable, or else the whole traversable, if it has less than n elements.
Parameters
n - the number of elements to take
Notes
Might return different results for different runs, unless this traversable is ordered

def drop(n : Int) : Repr
Returns this traversable without its n first elements If this traversable has less than n elements, the empty traversable is returned.
Parameters
n - the number of elements to drop
Returns
the new traversable
Notes
Might return different results for different runs, unless this traversable is ordered

def slice(from : Int, until : Int) : Repr
A sub-traversable starting at index `from` and extending up to (but not including) index `until`.
Notes
c.slice(from, to) is equivalent to (but possibly more efficient than) c.drop(from).take(to - from)
Might return different results for different runs, unless this traversable is ordered
Parameters
from - The index of the first element of the returned subsequence
until - The index of the element following the returned subsequence

def takeWhile(p : (A) => Boolean) : Repr
Returns the longest prefix of this traversable whose elements satisfy the predicate p.
Parameters
p - the test predicate.
Notes
Might return different results for different runs, unless this traversable is ordered

def dropWhile(p : (A) => Boolean) : Repr
Returns the longest suffix of this traversable whose first element does not satisfy the predicate p.
Parameters
p - the test predicate.
Notes
Might return different results for different runs, unless this traversable is ordered

def span(p : (A) => Boolean) : (Repr, Repr)
Returns a pair consisting of the longest prefix of the traversable whose elements all satisfy the given predicate, and the rest of the traversable.
Parameters
p - the test predicate
Returns
a pair consisting of the longest prefix of the traversable whose elements all satisfy p, and the rest of the traversable.
Notes
Might return different results for different runs, unless this traversable is ordered

def splitAt(n : Int) : (Repr, Repr)
Split the traversable at a given point and return the two parts thus created.
Parameters
n - the position at which to split
Returns
a pair of traversables composed of the first n elements, and the other elements.
Notes
Might return different results for different runs, unless this traversable is ordered

def copyToBuffer[B >: A](dest : Buffer[B]) : Unit
Copy all elements of this traversable to a given buffer
Notes
Will not terminate for infinite-sized collections.
Parameters
dest - The buffer to which elements are copied

def copyToArray[B >: A](xs : Array[B], start : Int, len : Int) : Unit
Fills the given array xs with at most `len` elements of this traversable starting at position `start`. Copying will stop once either the end of the current traversable is reached or `len` elements have been copied or the end of the array is reached.
Notes
Will not terminate for infinite-sized collections.
Parameters
xs - the array to fill.
start - starting index.
len - number of elements to copy

def copyToArray[B >: A](xs : Array[B], start : Int) : Unit
Fills the given array xs with the elements of this traversable starting at position start until either the end of the current traversable or the end of array `xs` is reached.
Notes
Will not terminate for infinite-sized collections.
Parameters
xs - the array to fill.
start - starting index.
Precondition
the array must be large enough to hold all elements.

def toArray[B >: A](implicit evidence$1 : ClassManifest[B]) : Array[B]
Converts this traversable to a fresh Array containing all elements.
Notes
Will not terminate for infinite-sized collections.

def toList : List[A]
Returns a list with all elements of this traversable object.
Notes
Will not terminate for infinite-sized collections.

def toIterable : Iterable[A]
Returns a traversable with all elements in this traversable object.
Notes
Will not terminate for infinite-sized collections.

def toSeq : Seq[A]
Returns a sequence with all elements in this traversable object.
Notes
Will not terminate for infinite-sized collections.

def toIndexedSeq[B >: A] : IndexedSeq[B]
Returns a IndexedSeq with all elements in this traversable object.
Notes
Will not terminate for infinite-sized collections.

def toStream : Stream[A]
Returns a stream with all elements in this traversable object.

def toSet[B >: A] : Set[B]
Returns an immutable set with all unique elements in this traversable object.

def mkString(start : java.lang.String, sep : java.lang.String, end : java.lang.String) : java.lang.String
Returns a string representation of this traversable object. The resulting string begins with the string start and is finished by the string end. Inside, the string representations of elements (w.r.t. the method toString()) are separated by the string sep.
Examples
List(1, 2, 3).mkString("(", "; ", ")") = "(1; 2; 3)"
Parameters
start - starting string.
sep - separator string.
end - ending string.
Returns
a string representation of this traversable object.

def mkString(sep : java.lang.String) : java.lang.String
Returns a string representation of this traversable object. The string representations of elements (w.r.t. the method toString()) are separated by the string sep.
Parameters
sep - separator string.
Returns
a string representation of this traversable object.

def mkString : java.lang.String
Returns a string representation of this traversable object. The string representations of elements (w.r.t. the method toString()) follow each other without any separator string.

def addString(b : StringBuilder, start : java.lang.String, sep : java.lang.String, end : java.lang.String) : StringBuilder
Write all elements of this traversable into given string builder. The written text begins with the string start and is finished by the string end. Inside, the string representations of elements (w.r.t. the method toString()) are separated by the string sep.

def addString(b : StringBuilder, sep : java.lang.String) : StringBuilder
Write all elements of this string into given string builder. The string representations of elements (w.r.t. the method toString()) are separated by the string sep.

def addString(b : StringBuilder) : StringBuilder
Write all elements of this string into given string builder without using any separator between consecutive elements.

override def toString : java.lang.String
Returns a string representation of the object.

The default representation is platform dependent.

Returns
a string representation of the object.


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

def view : TraversableView[A, Repr]
Creates a view of this traversable @see TraversableView

def view(from : Int, until : Int) : TraversableView[A, Repr]
A sub-traversable starting at index `from` and extending up to (but not including) index `until`.
Parameters
from - The index of the first element of the slice
until - The index of the element following the slice
Notes
The difference between `view` and `slice` is that `view` produces a view of the current traversable, whereas `slice` produces a new traversable.
Might return different results for different runs, unless this traversable is ordered
view(from, to) is equivalent to view.slice(from, to)

def withFilter(p : (A) => Boolean) : WithFilter