All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ecwid.clickhouse.mapped.MappedIterator.kt Maven / Gradle / Ivy

package com.ecwid.clickhouse.mapped

import com.ecwid.clickhouse.typed.TypedRow

internal class MappedIterator(
	private val typedIterator: Iterator,
	private val mapper: (TypedRow) -> T
) : AbstractIterator() {

	override fun computeNext() {
		if (typedIterator.hasNext()) {
			val typedRow = typedIterator.next()
			val mappedValue = mapper(typedRow)

			setNext(mappedValue)
		} else {
			done()
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy