Scala Library
|
|
scala/Stream.scala
]
object
Stream
extends
AnyRefStream
provides helper functions
to manipulate streams.Value Summary | |
val
|
empty
: Stream[Nothing]
The empty stream
|
Method Summary | |
def
|
apply [A](xs : A*) : Stream[A] |
def
|
concat
[A](xs : Iterable[Stream[A]]) : Stream[A]
The concatenation of a sequence of streams
|
def
|
concat
[A](s1 : Stream[A], s2 : Stream[A], ss : Stream[A]*) : Stream[A]
The concatenation of all given streams
|
def
|
concat
[A](xs : Iterator[Stream[A]]) : Stream[A]
The concatenation of all streams returned by an iterator
|
def
|
const
[A](elem : A) : Stream[A]
Create an infinite stream containing the given element.
|
def
|
from
(start : Int, step : Int) : Stream[Int]
Create an infinite stream starting at
start
and incrementing by step step |
def
|
from
(start : Int) : Stream[Int]
Create an infinite stream starting at
start
and incrementing by 1. |
def
|
fromIterator
[A](it : Iterator[A]) : Stream[A]
A stream containing all elements of a given iterator, in the order they are produced.
|
def
|
make
[A](n : Int, elem : A) : Stream[A]
Create a stream containing several copies of an element.
|
def
|
range
(start : Int, end : Int) : Stream[Int]
Create a stream with element values
vn+1 = vn + 1
where v0 = start
and vi < end . |
def
|
range
(start : Int, end : Int, step : (Int) => Int) : Stream[Int]
Create a stream with element values
vn+1 = step(vn)
where v0 = start
and elements are in the range between start (inclusive)
and end (exclusive) |
final def
|
range
(start : Int, end : Int, step : Int) : Stream[Int]
Create a stream with element values
vn+1 = vn + step
where v0 = start
and elements are in the range between start (inclusive)
and end (exclusive) |
def
|
unapplySeq [A](xs : Stream[A]) : Option[Seq[A]] |
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
|
Definite
[+A] extends Stream[A] with () => Stream[A]
a stream with a definite size
|
Object Summary | |
object
|
cons
extends AnyRef
|
object
|
lazy_::
extends AnyRef
|
Value Details |
Method Details |
it -
The iterator producing the stream's elementsvn+1 = vn + 1
where v0 = start
and vi < end
.start -
the start value of the streamend -
the end value of the streamstart
.vn+1 = vn + step
where v0 = start
and elements are in the range between start
(inclusive)
and end
(exclusive)start -
the start value of the streamend -
the end value of the streamstep -
the increment value of the streamstart
.vn+1 = step(vn)
where v0 = start
and elements are in the range between start
(inclusive)
and end
(exclusive)start -
the start value of the streamend -
the end value of the streamstep -
the increment function of the stream, must be monotonically increasing or decreasingstart
.start
and incrementing by step step
start -
the start value of the streamstep -
the increment value of the streamstart
.start
and incrementing by 1.start -
the start value of the streamstart
.elem -
the element composing the resulting streamn -
the length of the resulting streamelem -
the element composing the resulting stream
Scala Library
|
|