Scala Library
|
|
trait
TraversableProxyLike[+A, +This <: TraversableLike[A, This] with
Traversable[A]]
extends
TraversableLike[A, This] with
ProxyMethod Summary | |
override def
|
++
[B >: A, That](that : Traversable[B])(implicit bf : CanBuildFrom[This, B, That]) : That
Creates a new traversable of type `That` which contains all elements of this traversable
followed by all elements of another traversable.
|
override def
|
++
[B >: A, That](that : Iterator[B])(implicit bf : CanBuildFrom[This, B, That]) : That
Creates a new traversable of type `That` which contains all elements of this traversable
followed by all elements of an iterator.
|
override 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 |
override def
|
:\
[B](z : B)(op : (A, B) => B) : B
An alias for
foldRight .
That is, xs :\ z is the same as xs foldRight z |
override def
|
addString
(b : StringBuilder) : StringBuilder
Write all elements of this string into given string builder without using
any separator between consecutive elements.
|
override 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 . |
override 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 . |
override 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. |
override 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. |
override def
|
copyToBuffer
[B >: A](dest : Buffer[B]) : Unit
Copy all elements of this traversable to a given buffer
|
override def
|
count
(p : (A) => Boolean) : Int
Count the number of elements in the traversable which satisfy a predicate.
|
override def
|
drop
(n : Int) : This
Returns this traversable without its
n first elements
If this traversable has less than n elements, the empty
traversable is returned. |
override def
|
dropWhile
(p : (A) => Boolean) : This
Returns the longest suffix of this traversable whose first element
does not satisfy the predicate
p . |
override def
|
exists
(p : (A) => Boolean) : Boolean
Return true iff there is an element in this traversable for which the
given predicate `p` yields true.
|
override def
|
filter
(p : (A) => Boolean) : This
Returns all the elements of this traversable that satisfy the
predicate
p . The order of the elements is preserved. |
override def
|
filterNot
(p : (A) => Boolean) : This
Returns a traversable with all elements of this traversable which do not satisfy the predicate
p . |
override def
|
find
(p : (A) => Boolean) : Option[A]
Find and return the first element of the traversable object satisfying a
predicate, if any.
|
override def
|
flatMap
[B, That](f : (A) => Traversable[B])(implicit bf : CanBuildFrom[This, B, That]) : That
Applies the given function
f to each element of
this traversable, then concatenates the results in a traversable of type That. |
override 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 . |
override 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 . |
override def
|
forall
(p : (A) => Boolean) : Boolean
Return true iff the given predicate `p` yields true for all elements
of this traversable.
|
override def
|
foreach
[B](f : (A) => B) : Unit
Apply a function
f to all elements of this
traversable object. |
override def
|
groupBy
[K](f : (A) => K) : Map[K, This]
Partition this traversable into a map of traversables
according to some discriminator function.
@invariant (xs partition f)(k) = xs filter (x => f(x) == k)
|
override 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.
|
override def
|
head
: A
The first element of this traversable.
|
override def
|
headOption
: Option[A]
Returns as an option the first element of this traversable
or
None if traversable is empty. |
override def
|
init
: This
a traversable consisting of all elements of this traversable except the last one.
|
override def
|
isEmpty
: Boolean
Does this collection contain no elements?
|
override def
|
last
: A
The last element of this traversable.
|
override def
|
lastOption
: Option[A]
Returns as an option the last element of this traversable or
None if traversable is empty. |
override def
|
map
[B, That](f : (A) => B)(implicit bf : CanBuildFrom[This, 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`. |
override 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 . |
override 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 . |
override 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. |
override def
|
nonEmpty
: Boolean
Does this collection contain some elements?
|
override def
|
partition
(p : (A) => Boolean) : (This, This)
Partitions this traversable in two traversables according to a predicate.
|
override 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 |
override 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 |
override 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 |
override 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. |
override def
|
remove
(p : (A) => Boolean) : This
Returns a traversable with all elements of this traversable which do not satisfy the predicate
p . |
abstract def
|
self : This |
override def
|
size
: Int
The number of elements in this collection
|
override def
|
slice
(from : Int, until : Int) : This
A sub-traversable starting at index `from`
and extending up to (but not including) index `until`.
|
override def
|
span
(p : (A) => Boolean) : (This, This)
Returns a pair consisting of the longest prefix of the traversable whose
elements all satisfy the given predicate, and the rest of the traversable.
|
override def
|
splitAt
(n : Int) : (This, This)
Split the traversable at a given point and return the two parts thus
created.
|
override def
|
stringPrefix
: java.lang.String
Defines the prefix of this object's
toString representation. |
override def
|
tail
: This
a traversable consisting of all elements of this traversable
except the first one.
|
override def
|
take
(n : Int) : This
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. |
override def
|
takeWhile
(p : (A) => Boolean) : This
Returns the longest prefix of this traversable whose elements satisfy
the predicate
p . |
override def
|
toArray
[B >: A](implicit evidence$1 : ClassManifest[B]) : Array[B]
Converts this traversable to a fresh Array containing all elements.
|
override def
|
toIterable
: Iterable[A]
Returns a traversable with all elements in this traversable object.
|
override def
|
toList
: List[A]
Returns a list with all elements of this traversable object.
|
override def
|
toSeq
: Seq[A]
Returns a sequence with all elements in this traversable object.
|
override def
|
toSet
[B >: A] : Set[B]
Returns an immutable set with all unique elements in this traversable object.
|
override def
|
toStream
: Stream[A]
Returns a stream with all elements in this traversable object.
|
override def
|
view
(from : Int, until : Int) : TraversableView[A, This]
A sub-traversable starting at index `from`
and extending up to (but not including) index `until`.
|
override def
|
view
: TraversableView[A, This]
Creates a view of this traversable @see TraversableView
|
Methods inherited from Proxy | |
hashCode, equals, toString |
Methods inherited from TraversableLike | |
newBuilder (abstract), repr, thisCollection, toCollection, partialMap, sum, product, min, max, toIndexedSeq, withFilter |
Methods inherited from AnyRef | |
getClass, clone, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Method Details |
abstract
def
self : This
f
to all elements of this
traversable object.f -
A function that is applied for its side-effect to every element. The result (of arbitrary type U) of function `f` is discarded.override
def
isEmpty : Boolean
override
def
nonEmpty : Boolean
override
def
size : Int
override
def
hasDefiniteSize : Boolean
override
def
++[B >: A, That](that : Traversable[B])(implicit
bf : CanBuildFrom[This, B, That]) : That
that -
The traversable to appendthat -
The iterator to appendf
to each element of this traversable and collecting the results
in a traversable of type `That`.f -
function to apply to each element.override
def
flatMap[B, That](f : (A) => Traversable[B])(implicit
bf : CanBuildFrom[This, B, That]) : That
f
to each element of
this traversable, then concatenates the results in a traversable of type That.f -
the function to apply on each element.p
. The order of the elements is preserved.p -
the predicate used to filter the traversable.p
.p
.p -
the predicate used to test elementsp
p
.p -
the predicate used to test elementsp
p -
the predicate on which to partitionp
and the traversable that does not.
The relative order of the elements in the resulting traversables
is the same as in the original traversable.p -
the predicatep -
the predicatep -
the predicate for which to countp
.p -
the predicatep
, or None
if none exists.f
, from left to right, and starting with
the value z
.f(... (f(f(z, a0), a1) ...), an)
if the traversable is
[a0, a1, ..., an]
.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
f
, from right to left, and starting with
the value z
.f(a0, f(a1, f(..., f(an, z)...)))
if the traversable is [a0, a1, ..., an]
.foldRight
.
That is, xs :\ z
is the same as xs foldRight z
op
, from left to rightop -
The operator to applyop(... op(a0,a1), ..., an)
if the traversable object has elements
a0, a1, ..., an
.op
, from left to rightop -
The operator to applyop
, from right to leftop -
The operator to applya0 op (... op (an-1 op an)...)
if the traversable object has elements a0, a1, ...,
an
.op
, from right to left.op -
The operator to applyoverride
def
head : A
None
if traversable is empty.override
def
tail : This
override
def
last : A
None
if traversable is empty.override
def
init : This
n
elements of this traversable, or else the whole traversable, if it has less
than n
elements.n -
the number of elements to taken
first elements
If this traversable has less than n
elements, the empty
traversable is returned.n -
the number of elements to dropfrom -
The index of the first element of the returned subsequenceuntil -
The index of the element following the returned subsequencep
.p -
the test predicate.p
.p -
the test predicate.p -
the test predicatep
, and the rest of the traversable.n -
the position at which to splitn
elements, and the other elements.dest -
The buffer to which elements are copiedxs
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.xs -
the array to fill.start -
starting index.len -
number of elements to copyxs
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.xs -
the array to fill.start -
starting index.override
def
toArray[B >: A](implicit
evidence$1 : ClassManifest[B]) : Array[B]
override
def
mkString(start : java.lang.String, sep : java.lang.String, end : java.lang.String) : java.lang.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
.List(1, 2, 3).mkString("(", "; ", ")") = "(1; 2; 3)"
start -
starting string.sep -
separator string.end -
ending string.override
def
mkString(sep : java.lang.String) : java.lang.String
toString()
)
are separated by the string sep
.sep -
separator string.override
def
mkString : java.lang.String
toString()
)
follow each other without any separator string.override
def
addString(b : StringBuilder, start : java.lang.String, sep : java.lang.String, end : java.lang.String) : StringBuilder
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
.override
def
addString(b : StringBuilder, sep : java.lang.String) : StringBuilder
toString()
)
are separated by the string sep
.override
def
addString(b : StringBuilder) : StringBuilder
override
def
stringPrefix : java.lang.String
toString
representation.override
def
view : TraversableView[A, This]
override
def
view(from : Int, until : Int) : TraversableView[A, This]
from -
The index of the first element of the sliceuntil -
The index of the element following the slice
Scala Library
|
|