asSequence

kotlin-stdlib / kotlin.streams / java.util.stream.DoubleStream / asSequence
 

Platform and version requirements: JVM (1.2), JRE8 (1.2) 

fun DoubleStream.asSequence(): Sequence<Double> 
 Creates a Sequence instance that wraps the original stream iterating through its elements. import java.util.stream.*
import kotlin.streams.*

fun main(args: Array<String>) {
//sampleStart
val doubleStream: DoubleStream = DoubleStream.of(1e2, 1e3, 1e4)
val doubleSequence: Sequence<Double> = doubleStream.asSequence()
println(doubleSequence.joinToString(", ")) // 100.0, 1000.0, 10000.0
//sampleEnd
} 


    
{'path': 'public/docs/kotlin~1.7/api/latest/jvm/stdlib/kotlin.streams/java.util.stream.-double-stream/as-sequence.html', 'source': 'DevDocs.IO'}