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:
  IterableWrapper.IteratorWrapper, MapWrapper.IteratorWrapper, MutableIterator.Map, MutableIterator.Buffered, MutableIterator.Buffered.Filter, SeqIterator, SortedSet.Range.RangeIterator

Method Summary
`def` | buffered0 : Buffered
`override def` | filter (f : (A) => Boolean) : MutableIterator[A] Returns an iterator over all the elements of this iterator that satisfy the predicate `p`. The order of the elements is preserved.
`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, append, ++, flatMap, takeWhile, dropWhile, zip, zipWithIndex, foreach, forall, exists, contains, find, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, buffered, counted, duplicate, copyToArray, copyToBuffer, toList, mkString, mkString, addString

Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized

Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf

Class Summary
`trait` | Buffered `extends` MutableIterator[A]
`class` | BufferedImpl `extends` Buffered
`class` | Map [B](f : (A) => B)`extends` MutableIterator[B] Standard implementation of a mapped iterator.

Method Details

`abstract` `def` remove : Unit

`override` `def` filter(f : (A) => Boolean) : MutableIterator[A]

  Returns an iterator over all the elements of this iterator that satisfy the predicate `p`. The order of the elements is preserved.

Parameters
  `p -` the predicate used to filter the iterator.
Returns
  the elements of this iterator satisfying `p`.

Overrides Iterator.filter

`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.

`` `def` buffered0 : Buffered