p

Stream.A

package A

Abstract Stream bases

Generally a Stream can be defined with just two methods: prime and pump and fully pumped with a loop:

class TenIntsStream extends Stream.A.Base[Int] {
  var i = 0

  def prime = i < 10

  def pump = { i += 1; i }
}

val s = new TenIntsStream

while (s.prime) print(s.pump + " ") // Prints 1 2 3 4 5 6 7 8 9 10

This resembles Iterator with 'hasNext' and 'next' methods.

The difference is: pump MUST NEVER be called without preceding successful prime. This rule adds about 10% speed increase

Ordering
  1. Alphabetic
Inherited
  1. A
  2. scala.AnyRef
  3. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Method

  1. def assertIlk[A](s: Stream[A], ilk: Any.Ilk): Stream[A]
    Definition Classes
    A
  2. def assertSize[A](s: Stream[A], sz: Int): Stream[A]
    Definition Classes
    A
  3. def assertSorted[A](s: Stream[A], o: Ordering[A]): Stream[A]
    Definition Classes
    A
  4. def assertSortedBy[A, B](s: Stream[A], o: Ordering[B], f: (A) ⇒ B): Stream[A]
    Definition Classes
    A
Linear Supertypes
AnyRef, Any
Source: package.scala