| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |
trait Iterator[+ A]
extends
ScalaObject
hasNext method for checking
if there is a next element available, and a next method
which returns the next element and discards it from the iterator.
- Martin Odersky, Matthias Zenger - 1.2, 15/03/2004| buffered |
def buffered
Returns a buffered iterator from this iterator
|
BufferedIterator[A] | |
| collect |
def collect
Collect elements into a seq
[details]
|
Seq[A] | |
| counted |
def counted
Returns a counted iterator from this iterator
|
CountedIterator[A] | |
| hasNext |
abstract def hasNext
Does this iterator provide another element?
|
Boolean | |
| mkString |
def mkString
Returns a string representation of this iterable object
[details]
The string
representations of elements (w.r.t. the method
toString())
are separated by a comma.
|
String | |
| toList |
def toList
Transform this iterator into a list of all elements
[details]
|
List[A] |
| != |
final def !=(arg0 : Object)
|
Boolean | AnyRef |
| != |
final def !=(arg0 : Any)
o != arg0 is the same as !(o == (arg0))
[details]
|
Boolean | Any |
| ++ |
def ++[B >: A](that : => Iterator[B])
Returns a new iterator that first yields the elements of this
iterator followed by the elements provided by iterator
that
|
Iterator[B] | |
| /: |
def /:[B](z : B)(op : (B, A) => B)
Similar to
foldLeft but can be used as
an operator with the order of iterator 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)
|
B | |
| == |
final def ==(arg0 : Any)
o == arg0 is the same as o
[details]
|
Boolean | Any |
| == |
final def ==(arg0 : Object)
o == arg0 is the same as if (o eq null) arg0 eq null else o
[details]
|
Boolean | AnyRef |
| addString |
def addString(buf : StringBuilder, start : String, sep : String, end : String)
Write all elements of this string into given string builder
[details]
|
StringBuilder | |
| append |
def append[B >: A](that : Iterator[B])
Returns a new iterator that first yields the elements of this
iterator followed by the elements provided by iterator
that
[details]
|
Iterator[B] | |
| 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 |
| contains |
def contains(elem : Any)
Tests if the given value
elem is a member of this iterator
[details]
|
Boolean | |
| 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 buffer
[details]
|
Unit | |
| drop |
def drop(n : Int)
Removes the first
n elements from this iterator
[details]
|
Iterator[A] | |
| dropWhile |
def dropWhile(p : (A) => Boolean)
Skips longest sequence of elements of this iterator which satisfy given
predicate
p, and returns an iterator of the remaining elements
[details]
|
Iterator[A] | |
| duplicate |
def duplicate
Creates two new iterators that both iterate over the same elements
than this iterator (in the same order)
[details]
|
(Iterator[A], Iterator[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 an iterator over all the elements of this iterator that
satisfy the predicate
p
[details]
The order of the elements
is preserved.
|
Iterator[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) => Iterator[B])
Applies the given function
f to each element of
this iterator, then concatenates the results
[details]
|
Iterator[B] | |
| foldLeft |
def foldLeft[B](z : B)(op : (B, A) => B)
Combines the elements of this iterator together using the binary
operator
op, 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 iterator together using the binary
operator
op, 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 a new iterator that maps all elements of this iterator
to new elements using function
f
|
Iterator[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 the elements in this iterator
[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.
Ex: List(1, 2, 3).mkString("(", "; ", ")") = "(1; 2; 3)"
|
String | |
| ne |
final def ne(arg0 : Object)
o
[details]
|
Boolean | AnyRef |
| next |
abstract def next
Returns the next element
|
A | |
| 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 |
| readInto |
def readInto[B >: A](xs : Array[B], start : Int)
|
Unit | |
| readInto |
def readInto[B >: A](xs : Array[B])
|
Unit | |
| readInto |
def readInto[B >: A](xs : Array[B], start : Int, sz : Int)
Fills the given array
xs with the elements of
this sequence starting at position start
[details]
Like
copyToArray,
but designed to accomodate IO stream operations.
|
Unit | |
| reduceLeft |
def reduceLeft[B >: A](op : (B, A) => B)
Combines the elements of this iterator 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 iterator together using the binary
operator
op, from right to left
[details]
|
B | |
| slice |
def slice(from : Int, until : Int)
A sub-iterator of
until - from elements
starting at index |
Iterator[A] | |
| synchronized |
final def synchronized[T0](arg0 : T0)
|
T0 | AnyRef |
| take |
def take(n : Int)
Returns a new iterator that iterates only over the first
n
elements
[details]
|
Iterator[A] | |
| takeWhile |
def takeWhile(p : (A) => Boolean)
Returns an iterator over the longest prefix of this iterator such that
all elements of the result satisfy the predicate
p
[details]
The order of the elements is preserved.
|
Iterator[A] | |
| toString |
override def toString
Returns a string representation of the object
[details]
The default representation is platform dependent.
|
String | |
| wait |
final def wait(arg0 : Long, arg1 : Int)
|
Unit | AnyRef |
| wait |
final def wait(arg0 : Long)
|
Unit | AnyRef |
| wait |
final def wait
|
Unit | AnyRef |
| zip |
def zip[B](that : Iterator[B])
Return an iterator formed from this iterator and the specified iterator
that by associating each element of the former with
the element at the same position in the latter
[details]
If one of the two iterators is longer than the other, its remaining elements are ignored.
|
Iterator[(A, B)] | |
| zipWithIndex |
def zipWithIndex
Return an iterator that pairs each element of this iterator
with its index, counting from 0
[details]
|
Iterator[(A, Int)] |
| OVERVIEW | PACKAGE | CONSTR | FIELDS | METHODS | FRAMES NO FRAMES | INHERITED |