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

commonMain.it.unibo.tuprolog.solve.sideffects.SideEffectsBuilder.kt Maven / Gradle / Ivy

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

import it.unibo.tuprolog.solve.sideffects.impl.SideEffectsBuilderImpl
import it.unibo.tuprolog.utils.dequeOf
import kotlin.jvm.JvmStatic

interface SideEffectsBuilder : SideEffectFactory {
    val sideEffects: MutableList

    fun buildArray(): Array = sideEffects.toTypedArray()

    fun build(): List = sideEffects.toList()

    companion object {
        @JvmStatic
        fun empty(): SideEffectsBuilder = SideEffectsBuilderImpl(dequeOf())

        @JvmStatic
        fun of(sideEffects: Iterable): SideEffectsBuilder = SideEffectsBuilderImpl(dequeOf(sideEffects))

        @JvmStatic
        fun of(sideEffects: Sequence): SideEffectsBuilder = SideEffectsBuilderImpl(dequeOf(sideEffects))

        @JvmStatic
        fun of(vararg sideEffects: SideEffect): SideEffectsBuilder = SideEffectsBuilderImpl(dequeOf(*sideEffects))
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy