org.pkl.thirdparty.kotlin.collections.Sequence.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pkl-tools Show documentation
Show all versions of pkl-tools Show documentation
Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.
/*
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.pkl.thirdparty.kotlin.sequences
/**
* A sequence that returns values through its iterator. The values are evaluated lazily, and the sequence
* is potentially infinite.
*
* Sequences can be iterated multiple times, however some sequence implementations might constrain themselves
* to be iterated only once. That is mentioned specifically in their documentation (e.g. [generateSequence] overload).
* The latter sequences throw an exception on an attempt to iterate them the second time.
*
* Sequence operations, like [Sequence.map], [Sequence.filter] etc, generally preserve that property of a sequence, and
* again it's documented for an operation if it doesn't.
*
* @param T the type of elements in the sequence.
*/
public interface Sequence {
/**
* Returns an [Iterator] that returns the values from the sequence.
*
* Throws an exception if the sequence is constrained to be iterated once and `iterator` is invoked the second time.
*/
public operator fun iterator(): Iterator
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy