com.nicta.scoobi.core

Iterator1

trait Iterator1[+A] extends TraversableOnce[A]

A non-empty iterator contains at least one element. Consequences include:

- reduceLeft will always produce a value. - first will always produce a value. - next will always produce a value on its first invocation. - hasNext will always return true on its first invocation. - scanLeft1 will always produce a value.

Some operations on a non-empty iterator result in a non-empty iterator.

Construction of an Iterator1 is typically performed with the +:: method, defined on Iterator1.RichIterator.

For example:

import Iterator1._

// A regular iterator.
val x: Iterator[Int] = ...
// Constructs a non-empty iterator with 74 at the first.
val y: Iterator1[Int] = 77 +:: x

NOTE: Most Iterator functions perform SIDE-EFFECTS and so EQUATIONAL REASONING DOES NOT APPLY.

Linear Supertypes
TraversableOnce[A], GenTraversableOnce[A], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Iterator1
  2. TraversableOnce
  3. GenTraversableOnce
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def first: A

    The constant first element of this iterator.

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def ++[AA >: A](that: ⇒ Iterator1[AA]): Iterator1[AA]

    Append the given iterator to this iterator.

  5. def /:[B](z: B)(op: (B, A) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  6. def :\[B](z: B)(op: (A, B) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  7. def <*>:[B](f: Iterator1[(A) ⇒ B]): Iterator1[B]

    Runs the iterator sequence effect (flatMap) of functions on this iterator.

    Runs the iterator sequence effect (flatMap) of functions on this iterator. Synonym for ap.

  8. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  9. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  10. def addString(b: StringBuilder): StringBuilder

    Definition Classes
    TraversableOnce
  11. def addString(b: StringBuilder, sep: String): StringBuilder

    Definition Classes
    TraversableOnce
  12. def addString(b: StringBuilder, start: String, sep: String, end: String): StringBuilder

    Definition Classes
    TraversableOnce
  13. def aggregate[B](z: B)(seqop: (B, A) ⇒ B, combop: (B, B) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  14. def ap[B](f: Iterator1[(A) ⇒ B]): Iterator1[B]

    Runs the iterator sequence effect (flatMap) of functions on this iterator.

    Runs the iterator sequence effect (flatMap) of functions on this iterator. Synonym for <*>:.

  15. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  16. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. def collect[B](pf: PartialFunction[A, B]): Iterator[B]

    Return the first element in the iterator satisfying the given predicate, mapping the given function.

  18. def collectFirst[B](pf: PartialFunction[A, B]): Option[B]

    Definition Classes
    TraversableOnce
  19. def contains(elem: Any): Boolean

    True if any elements of the iterator are equal to the given value.

  20. def copyToArray[AA >: A](xs: Array[AA], start: Int, n: Int): Unit

    Copies this iterator to an array at the given interval.

    Copies this iterator to an array at the given interval.

    Definition Classes
    Iterator1 → TraversableOnce → GenTraversableOnce
  21. def copyToArray[B >: A](xs: Array[B]): Unit

    Definition Classes
    TraversableOnce → GenTraversableOnce
  22. def copyToArray[B >: A](xs: Array[B], start: Int): Unit

    Definition Classes
    TraversableOnce → GenTraversableOnce
  23. def copyToBuffer[B >: A](dest: Buffer[B]): Unit

    Definition Classes
    TraversableOnce
  24. def count(p: (A) ⇒ Boolean): Int

    Definition Classes
    TraversableOnce → GenTraversableOnce
  25. def drop(n: Int): Iterator[A]

    Drop at most the given number of elements from the front of the iterator.

  26. def dropWhile(p: (A) ⇒ Boolean): Iterator[A]

    Drop elements from the front of the iterator satisfying the given predicate.

  27. def duplicate: (Iterator1[A], Iterator1[A])

    Creates two new iterators that both iterate over the same elements as this iterator (in the same order).

    Creates two new iterators that both iterate over the same elements as this iterator (in the same order). The duplicate iterators are considered equal if they are positioned at the same element.

  28. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  29. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  30. def exists(p: (A) ⇒ Boolean): Boolean

    True if any elements of the iterator satisfy the given predicate.

    True if any elements of the iterator satisfy the given predicate.

    Definition Classes
    Iterator1 → TraversableOnce → GenTraversableOnce
  31. def filter(p: (A) ⇒ Boolean): Iterator[A]

    Return an iterator with only the elements satisfying the predicate.

  32. def filterNot(p: (A) ⇒ Boolean): Iterator[A]

    Return an iterator with only the elements not satisfying the predicate.

  33. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  34. def find(p: (A) ⇒ Boolean): Option[A]

    Return the first element in the iterator satisfying the given predicate.

    Return the first element in the iterator satisfying the given predicate.

    Definition Classes
    Iterator1 → TraversableOnce → GenTraversableOnce
  35. def flatMap[B](f: (A) ⇒ Iterator1[B]): Iterator1[B]

    Sequence an iterator function on all elements of the iterator.

  36. def flatten[I](implicit I1: (A) ⇒ Iterator1[I]): Iterator1[I]

    Flatten an iterator of iterator.

  37. def fold[A1 >: A](z: A1)(op: (A1, A1) ⇒ A1): A1

    Definition Classes
    TraversableOnce → GenTraversableOnce
  38. def foldLeft[B](z: B)(op: (B, A) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  39. def foldRight[B](z: B)(op: (A, B) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  40. def forall(p: (A) ⇒ Boolean): Boolean

    True if all elements of the iterator satisfy the given predicate.

    True if all elements of the iterator satisfy the given predicate.

    Definition Classes
    Iterator1 → TraversableOnce → GenTraversableOnce
  41. def foreach[U](f: (A) ⇒ U): Unit

    Execute an effect for each element of the iterator.

    Execute an effect for each element of the iterator.

    Definition Classes
    Iterator1 → TraversableOnce → GenTraversableOnce
  42. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  43. def hasDefiniteSize: Boolean

    A non-empty iterator always has a definite size.

    A non-empty iterator always has a definite size.

    Definition Classes
    Iterator1 → TraversableOnce → GenTraversableOnce
  44. def hasNext: Boolean

    True if this iterator can produce a value from next.

  45. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  46. def indexOf[AA >: A](elem: AA): Int

    Return the index (starting at 0) of the first element in the iterator equal to the given value or -1 if no such element exists.

  47. def indexWhere(p: (A) ⇒ Boolean): Int

    Return the index (starting at 0) of the first element in the iterator satisfying the given predicate or -1 if no such element exists.

  48. def isEmpty: Boolean

    The negation of hasNext.

    The negation of hasNext.

    Definition Classes
    Iterator1 → TraversableOnce → GenTraversableOnce
  49. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  50. def isTraversableAgain: Boolean

    A non-empty iterator is never traversable again.

    A non-empty iterator is never traversable again.

    Definition Classes
    Iterator1 → GenTraversableOnce
  51. def length: Int

    Return the number of elements in the iterator.

  52. def map[B](f: (A) ⇒ B): Iterator1[B]

    Map a function on all elements of the iterator.

  53. def max[B >: A](implicit cmp: Ordering[B]): A

    Definition Classes
    TraversableOnce → GenTraversableOnce
  54. def maxBy[B](f: (A) ⇒ B)(implicit cmp: Ordering[B]): A

    Definition Classes
    TraversableOnce → GenTraversableOnce
  55. def min[B >: A](implicit cmp: Ordering[B]): A

    Definition Classes
    TraversableOnce → GenTraversableOnce
  56. def minBy[B](f: (A) ⇒ B)(implicit cmp: Ordering[B]): A

    Definition Classes
    TraversableOnce → GenTraversableOnce
  57. def mkString: String

    Definition Classes
    TraversableOnce → GenTraversableOnce
  58. def mkString(sep: String): String

    Definition Classes
    TraversableOnce → GenTraversableOnce
  59. def mkString(start: String, sep: String, end: String): String

    Definition Classes
    TraversableOnce → GenTraversableOnce
  60. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  61. def next: A

    Produces a value if possible, or throws an exception if not possible.

    Produces a value if possible, or throws an exception if not possible. The method hasNext determines if a value can be produced.

  62. def nonEmpty: Boolean

    Definition Classes
    TraversableOnce → GenTraversableOnce
  63. final def notify(): Unit

    Definition Classes
    AnyRef
  64. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  65. def padTo[AA >: A](len: Int, elem: AA): Iterator1[AA]

    Appends an element value to the iterator until a given target length is reached.

  66. def partition(p: (A) ⇒ Boolean): BreakIterator1[A]

    Partition the iterator into those satisfying a predicate and those that do not.

  67. def product[B >: A](implicit num: Numeric[B]): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  68. def reduce[A1 >: A](op: (A1, A1) ⇒ A1): A1

    Definition Classes
    TraversableOnce → GenTraversableOnce
  69. def reduceLeft[B >: A](op: (B, A) ⇒ B): B

    Definition Classes
    TraversableOnce
  70. def reduceLeftOption[B >: A](op: (B, A) ⇒ B): Option[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  71. def reduceOption[A1 >: A](op: (A1, A1) ⇒ A1): Option[A1]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  72. def reduceRight[B >: A](op: (A, B) ⇒ B): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  73. def reduceRightOption[B >: A](op: (A, B) ⇒ B): Option[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  74. def reversed: List[A]

    Attributes
    protected[this]
    Definition Classes
    TraversableOnce
  75. def sameElements(that: Iterator1[_]): Boolean

    True if this iterator produces equal elements to the given iterator in the same order.

  76. def scanLeft[B](z: B)(op: (B, A) ⇒ B): Iterator1[B]

    Produces an iterator containing cumulative results of applying the operator going left to right.

  77. def scanLeft1[AA >: A](op: (AA, A) ⇒ AA): Iterator1[AA]

    Produces an iterator containing cumulative results of applying the operator going left to right, starting at head.

  78. def seq: Iterator[A]

    Return a regular iterator, losing the non-empty invariant in the type.

    Return a regular iterator, losing the non-empty invariant in the type.

    Definition Classes
    Iterator1 → TraversableOnce → GenTraversableOnce
  79. def sequenceFn[X, Y](implicit I: (A) ⇒ (X) ⇒ Y): (X) ⇒ Iterator1[Y]

    Runs the iterator of functions to produce a function to iterators.

  80. def size: Int

    Definition Classes
    TraversableOnce → GenTraversableOnce
  81. def slice(from: Int, to: Int): Iterator[A]

    Returns an interval of elements in the iterator.

  82. def span(p: (A) ⇒ Boolean): BreakIterator1[A]

    Split the iterator, taking from the front while the given predicate satisfies.

  83. def sum[B >: A](implicit num: Numeric[B]): B

    Definition Classes
    TraversableOnce → GenTraversableOnce
  84. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  85. def take(n: Int): Iterator[A]

    Take at most the given number of elements from the front of the iterator.

  86. def takeWhile(p: (A) ⇒ Boolean): Iterator[A]

    Take elements from the front of the iterator satisfying the given predicate.

  87. def to[Col[_]](implicit cbf: CanBuildFrom[Nothing, A, Col[A]]): Col[A]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  88. def toArray[B >: A](implicit arg0: ClassTag[B]): Array[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  89. def toBuffer[B >: A]: Buffer[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  90. def toIndexedSeq: IndexedSeq[A]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  91. def toIterable: Iterable[A]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  92. def toIterator: Iterator[A]

    Return a regular iterator, losing the non-empty invariant in the type.

    Return a regular iterator, losing the non-empty invariant in the type.

    Definition Classes
    Iterator1 → GenTraversableOnce
  93. def toList: List[A]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  94. def toMap[T, U](implicit ev: <:<[A, (T, U)]): Map[T, U]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  95. def toSeq: Seq[A]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  96. def toSet[B >: A]: Set[B]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  97. def toStream: Stream[A]

    Convert this iterator to a stream.

    Convert this iterator to a stream.

    Definition Classes
    Iterator1 → GenTraversableOnce
  98. def toString(): String

    Definition Classes
    Iterator1 → AnyRef → Any
  99. def toTraversable: Traversable[A]

    Returns a stream of this iterator.

    Returns a stream of this iterator.

    Definition Classes
    Iterator1 → TraversableOnce → GenTraversableOnce
  100. def toVector: Vector[A]

    Definition Classes
    TraversableOnce → GenTraversableOnce
  101. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  102. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  103. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  104. def withFilter(p: (A) ⇒ Boolean): Iterator[A]

    Return an iterator with only the elements satisfying the predicate.

  105. def zip[B](that: Iterator1[B]): Iterator1[(A, B)]

    Zip this iterator with the given iterator to produce an iterator of pairs.

  106. def zipAll[B, AA >: A, BB >: B](that: Iterator1[B], thisElem: AA, thatElem: BB): Iterator1[(AA, BB)]

    Creates an iterator formed from this iterator and another iterator by combining corresponding elements in pairs.

  107. def zipWithIndex: Iterator1[(A, Int)]

    Zip this iterator with the infinite iterator from 0 incrementing by 1, to produce an iterator of pairs.

Deprecated Value Members

  1. def /:\[A1 >: A](z: A1)(op: (A1, A1) ⇒ A1): A1

    Definition Classes
    GenTraversableOnce
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) use fold instead

Inherited from TraversableOnce[A]

Inherited from GenTraversableOnce[A]

Inherited from AnyRef

Inherited from Any

Ungrouped