scala
trait BufferedIterator

[source: `scala/BufferedIterator.scala`]

`` `trait` BufferedIterator[+A]
  `extends` Iterator[A]

  Buffered iterators are iterators which allow to inspect the next element without discarding it.

Author
  Martin Odersky
  SeanMcDirmid
Version
  2.0, 16/04/2007

Direct Known Subclasses:
  BufferedIterator.Advanced

Method Summary
`def` | advanced : Advanced[A]
`override def` | buffered : BufferedIterator[A] Returns a buffered iterator from this iterator.
`abstract def` | head : A Checks what the next available element is.
`def` | headOpt : Option[A]
`def` | readIf [T](f : PartialFunction[A, T]) : Option[T] iterates over and applies `f` to the next element if this iterator has a next element that `f` is defined for.
`def` | readWhile (f : (A) => Boolean) : Boolean iterates over elements as long as `f` is true for each element, returns whether anything was read

Methods inherited from Iterator
hasNext (abstract), next (abstract), take, drop, map, append, ++, flatMap, filter, takeWhile, dropWhile, zip, zipWithIndex, foreach, forall, exists, contains, find, foldLeft, foldRight, /:, :\, reduceLeft, reduceRight, counted, duplicate, copyToArray, readInto, readInto, readInto, copyToBuffer, toList, 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

Method Details

`abstract` `def` head : A

  Checks what the next available element is.

Returns
  the current element

`` `def` headOpt : Option[A]

`override` `def` buffered : BufferedIterator[A]

  Returns a buffered iterator from this iterator.

Overrides
  Iterator.buffered

`` `def` readIf[T](f : PartialFunction[A, T]) : Option[T]

  iterates over and applies `f` to the next element if this iterator has a next element that `f` is defined for.

`` `def` readWhile(f : (A) => Boolean) : Boolean

  iterates over elements as long as `f` is true for each element, returns whether anything was read

`` `def` advanced : Advanced[A]