scala.collection.jcl

trait MutableIterator

[source: scala/collection/jcl/MutableIterator.scala]

trait MutableIterator[A]
extends Iterator[A]
An iterator that supports the remove operation. These iterators wrap Java iterators, and so have the same fail fast behavior when dealing with concurrent modifications.
Author
Sean McDirmid
Direct Known Subclasses:
MapWrapper.IteratorWrapper, MutableIterator.Wrapper, MutableIterator.Map, SeqIterator

Method Summary
def has (a : A) : Boolean
A type-safe version of contains.
override def map [B](f : (A) => B) : MutableIterator[B]
Returns a new iterator that maps all elements of this iterator to new elements using function f.
def remove (a : A) : Boolean
Finds and removes the first instance of "a" through the iterator. After execution, the iterator's cursor is located where the removed element existed.
abstract def remove : Unit
def retain (p : (A) => Boolean) : Boolean
Removes all elements in the iterator that predicate "p" returns false on.
Methods inherited from Iterator
hasNext (abstract), next (abstract), take, drop, slice, append, ++, flatMap, filter, takeWhile, dropWhile, zip, zipWithIndex, foreach, forall, exists, contains, find, findIndexOf, indexOf, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, buffered, counted, duplicate, copyToArray, readInto, readInto, readInto, copyToBuffer, toList, collect, mkString, mkString, mkString, addString, toString
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 Map [B](f : (A) => B) extends MutableIterator[B]
Standard implementation of a mapped iterator.
Method Details
abstract def remove : Unit

override def map[B](f : (A) => B) : MutableIterator[B]
Returns a new iterator that maps all elements of this iterator to new elements using function f.
Overrides
Iterator.map

def has(a : A) : Boolean
A type-safe version of contains.

def remove(a : A) : Boolean
Finds and removes the first instance of "a" through the iterator. After execution, the iterator's cursor is located where the removed element existed.
Parameters
a - ..
Returns
false if "a" is not encountered in the iterator and the iterator's cursor is located at the end of its elements.

def retain(p : (A) => Boolean) : Boolean
Removes all elements in the iterator that predicate "p" returns false on.