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

commonMain.it.unibo.tuprolog.solve.channel.InputStore.kt Maven / Gradle / Ivy

There is a newer version: 1.0.4
Show newest version
package it.unibo.tuprolog.solve.channel

import it.unibo.tuprolog.solve.channel.impl.InputStoreImpl
import kotlin.js.JsName
import kotlin.jvm.JvmOverloads
import kotlin.jvm.JvmStatic

interface InputStore : ChannelStore, InputStore> {
    @JsName("stdIn")
    val stdIn: InputChannel

    @JsName("setStdIn")
    fun setStdIn(channel: InputChannel): InputStore

    companion object {
        const val STDIN = "stdin"

        @JsName("fromStandard")
        @JvmStatic
        @JvmOverloads
        fun fromStandard(input: InputChannel = InputChannel.stdIn()): InputStore =
            InputStoreImpl(input, mapOf("user_input" to input))

        @JsName("of")
        @JvmStatic
        fun of(channels: Map>): InputStore =
            if (STDIN in channels) {
                InputStoreImpl(channels[STDIN]!!, channels)
            } else {
                InputStoreImpl(InputChannel.stdIn(), channels)
            }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy