| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |
trait Iterable[+ A]
extends
ScalaObject
elements which returns an iterator over all the
elements contained in the collection.
- Matthias Zenger - If a collection has a known size, it should also sub-type Collection. Only potentially unbounded collections should directly sub-class Iterable.
- 1.1, 04/02/2004| elements |
abstract def elements
Creates a new iterator over all elements contained in this
object
[details]
|
Iterator[A] | |
| hasDefiniteSize |
def hasDefiniteSize
returns true iff this collection has a bound size
[details]
Many APIs in this trait will not work on collections of
unbound sizes.
|
Boolean | |
| isEmpty |
def isEmpty
Is this collection empty?
|
Boolean | |
| mkString |
def mkString
Converts a collection into a flat
String by each element's toString method
[details]
|
String | |
| projection |
def projection
returns a projection that can be used to call non-strict
filter,
map, and flatMap methods that build projections
of the collection
|
Projection[A] | |
| toList |
def toList
Returns a list containing all of the elements in this iterable object
[details]
|
List[A] | |
| toSeq |
def toSeq
Returns a sequence containing all of the elements in this iterable object
[details]
|
Seq[A] | |
| toStream |
def toStream
Returns a stream containing all of the elements in this iterable object
[details]
|
Stream[A] |
| != |
final def !=(arg0 : Any)
o != arg0 is the same as !(o == (arg0))
[details]
|
Boolean | Any |
| != |
final def !=(arg0 : Object)
|
Boolean | AnyRef |
| ++ |
def ++[B >: A](that : Iterable[B])
Appends two iterable objects
[details]
|
Collection[B] | |
| /: |
def /:[B](z : B)(op : (B, A) => B)
Similar to
foldLeft but can be used as
an operator with the order of list and zero arguments reversed
[details]
That is,
z /: xs is the same as xs foldLeft z
|
B | |
| :\ |
def :\[B](z : B)(op : (A, B) => B)
An alias for
foldRight
[details]
That is,
xs :\ z is the same as xs foldRight z
|
B | |
| == |
final def ==(arg0 : Object)
o == arg0 is the same as if (o eq null) arg0 eq null else o
[details]
|
Boolean | AnyRef |
| == |
final def ==(arg0 : Any)
o == arg0 is the same as o
[details]
|
Boolean | Any |
| addString |
def addString(buf : StringBuilder, sep : String)
Write all elements of this string into given string builder
[details]
|
StringBuilder | |
| addString |
def addString(buf : StringBuilder, start : String, sep : String, end : String)
Write all elements of this string into given string builder
[details]
|
StringBuilder | |
| addString |
def addString(buf : StringBuilder)
Write all elements of this string into given string builder, with no separator string
between elements
[details]
|
StringBuilder | |
| asInstanceOf |
final def asInstanceOf[T0]
This method is used to cast the receiver object to be of type
T0
[details]
Note that the success of a cast at runtime is modulo Scala's
erasure semantics. Therefore the expression
|
T0 | Any |
| clone |
protected def clone
This method creates and returns a copy of the receiver object
[details]
The default implementation of the
|
Object | AnyRef |
| concat |
def concat[B >: A](that : Iterable[B])
Appends two iterable objects
[details]
|
Collection[B] | |
| copyToArray |
def copyToArray[B >: A](xs : Array[B], start : Int)
Fills the given array
xs with the elements of
this sequence starting at position start
[details]
|
Unit | |
| copyToBuffer |
def copyToBuffer[B >: A](dest : Buffer[B])
Copy all elements to a given buffer
[details]
|
Unit | |
| drop |
def drop(n : Int)
Returns this iterable without its
n first elements
If this iterable has less than n elements, the empty
iterable is returned
[details]
|
Collection[A] | |
| dropWhile |
def dropWhile(p : (A) => Boolean)
Returns the longest suffix of this iterable whose first element
does not satisfy the predicate
p
[details]
|
Collection[A] | |
| eq |
final def eq(arg0 : Object)
This method is used to test whether the argument (
arg0) is a reference to the
receiver object (this)
[details]
The
eq method has three other properties.
When overriding the
|
Boolean | AnyRef |
| equals |
def equals(arg0 : Any)
This method is used to compare the receiver object (
this)
with the argument object (arg0) for equivalence
[details]
The default implementations of this method is an equivalence relation:
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
|
Boolean | AnyRef |
| exists |
def exists(p : (A) => Boolean)
Apply a predicate
p to all elements of this
iterable object and return true, iff there is at least one
element for which p yields true
[details]
|
Boolean | |
| filter |
def filter(p : (A) => Boolean)
Returns all the elements of this iterable that satisfy the
predicate
p
[details]
The order of the elements is preserved.
|
Iterable[A] | |
| finalize |
protected def finalize
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
[details]
The details of when and if the |
Unit | AnyRef |
| find |
def find(p : (A) => Boolean)
Find and return the first element of the iterable object satisfying a
predicate, if any
[details]
|
Option[A] | |
| findIndexOf |
def findIndexOf(p : (A) => Boolean)
Returns index of the first element satisying a predicate, or -1
[details]
|
Int | |
| flatMap |
def flatMap[B](f : (A) => Iterable[B])
Applies the given function
f to each element of
this iterable, then concatenates the results
[details]
|
Iterable[B] | |
| foldLeft |
def foldLeft[B](z : B)(op : (B, A) => B)
Combines the elements of this iterable object together using the binary
function
f, from left to right, and starting with
the value z
[details]
|
B | |
| foldRight |
def foldRight[B](z : B)(op : (A, B) => B)
Combines the elements of this list together using the binary
function
f, from right to left, and starting with
the value z
[details]
|
B | |
| forall |
def forall(p : (A) => Boolean)
Apply a predicate
p to all elements of this
iterable object and return true, iff the predicate yields
true for all elements
[details]
|
Boolean | |
| foreach |
def foreach(f : (A) => Unit)
Apply a function
f to all elements of this
iterable object
[details]
|
Unit | |
| getClass |
final def getClass
Returns a representation that corresponds to the dynamic class of the receiver object
[details]
The nature of the representation is platform dependent.
|
Class[Any] | AnyRef |
| hashCode |
def hashCode
Returns a hash code value for the object
[details]
The default hashing algorithm is platform dependent.
Note that it is allowed for two objects to have identical hash
codes (
|
Int | AnyRef |
| indexOf |
def indexOf[B >: A](elem : B)
Returns the index of the first occurence of the specified
object in this iterable object
[details]
|
Int | |
| isInstanceOf |
final def isInstanceOf[T0]
This method is used to test whether the dynamic type of the receiver object is
T0
[details]
Note that the test result of the test is modulo Scala's erasure
semantics. Therefore the expression
|
Boolean | Any |
| map |
def map[B](f : (A) => B)
Returns the iterable resulting from applying the given function
f to each element of this iterable
[details]
|
Iterable[B] | |
| mkString |
def mkString(sep : String)
Returns a string representation of this iterable object
[details]
The string
representations of elements (w.r.t. the method
toString())
are separated by the string sep.
|
String | |
| mkString |
def mkString(start : String, sep : String, end : String)
Returns a string representation of this iterable object
[details]
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.
|
String | |
| ne |
final def ne(arg0 : Object)
o
[details]
|
Boolean | AnyRef |
| notify |
final def notify
Wakes up a single thread that is waiting on the receiver object's monitor
|
Unit | AnyRef |
| notifyAll |
final def notifyAll
Wakes up all threads that are waiting on the receiver object's monitor
|
Unit | AnyRef |
| partition |
def partition(p : (A) => Boolean)
Partitions this iterable in two iterables according to a predicate
[details]
|
(Iterable[A], Iterable[A]) | |
| reduceLeft |
def reduceLeft[B >: A](op : (B, A) => B)
Combines the elements of this iterable object together using the binary
operator
op, from left to right
[details]
|
B | |
| reduceRight |
def reduceRight[B >: A](op : (A, B) => B)
Combines the elements of this iterable object together using the binary
operator
op, from right to left
[details]
|
B | |
| sameElements |
def sameElements[B >: A](that : Iterable[B])
Checks if the other iterable object contains the same elements
[details]
|
Boolean | |
| synchronized |
final def synchronized[T0](arg0 : T0)
|
T0 | AnyRef |
| take |
def take(n : Int)
Returns an iterable consisting only over the first
n
elements of this iterable, or else the whole iterable, if it has less
than n elements
[details]
|
Collection[A] | |
| takeWhile |
def takeWhile(p : (A) => Boolean)
Returns the longest prefix of this iterable whose elements satisfy
the predicate
p
[details]
|
Iterable[A] | |
| toString |
def toString
Returns a string representation of the object
[details]
The default representation is platform dependent.
|
String | AnyRef |
| wait |
final def wait
|
Unit | AnyRef |
| wait |
final def wait(arg0 : Long)
|
Unit | AnyRef |
| wait |
final def wait(arg0 : Long, arg1 : Int)
|
Unit | AnyRef |
| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |