AbstractChannelStore

abstract class AbstractChannelStore<T : Any, C : Channel<T>, Self : ChannelStore<T, C, Self>>(channels: Map<String, C>) : ChannelStore<T, C, Self> , Map<String, C>

Base ChannelStore implementation, backing the map by an immutable channels and implementing ChannelStore.findByTerm/ChannelStore.aliasesOf plus equals/hashCode/toString in terms of it; concrete stores (it.unibo.tuprolog.solve.channel.InputStore/it.unibo.tuprolog.solve.channel.OutputStore implementations) only need to add their well-known channels on top.

Constructors

Link copied to clipboard
constructor(channels: Map<String, C>)

Properties

Link copied to clipboard
open val current: C?

The channel aliased as CURRENT in this store, or null if none is set.

Link copied to clipboard

Every alias, other than CURRENT itself, under which current is also reachable.

Link copied to clipboard
open override val entries: Set<Map.Entry<String, C>>
Link copied to clipboard
open override val keys: Set<String>
Link copied to clipboard
open override val size: Int
Link copied to clipboard
open override val values: Collection<C>

Functions

Link copied to clipboard
open override fun aliasesOf(channel: C): Sequence<String>

Returns every alias under which channel is reachable in this store, excluding CURRENT.

Link copied to clipboard
open fun close(channel: C): Self

Channel.closes channel and returns a copy of this store without any alias pointing to it.

Link copied to clipboard
open override fun containsKey(key: String): Boolean
Link copied to clipboard
open override fun containsValue(value: C): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun findByTerm(streamTerm: Term): Sequence<C>

Returns every channel in this store whose Channel.streamTerm unifies with streamTerm.

Link copied to clipboard
open operator override fun get(key: String): C?
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator fun minus(other: String): Self

Returns a copy of this store without the entry aliased other (if any).

open operator fun minus(others: Iterable<String>): Self
abstract operator fun minus(others: Sequence<String>): Self

Returns a copy of this store without the entries aliased in others.

open fun minus(other: String, vararg others: String): Self

Returns a copy of this store without the entries aliased other or in others.

Link copied to clipboard
open operator fun plus(other: Pair<String, C>): Self

Returns a copy of this store with other added (overriding an existing entry with the same alias).

open operator fun plus(others: Iterable<Pair<String, C>>): Self
abstract operator fun plus(others: Map<String, C>): Self
open operator fun plus(others: Sequence<Pair<String, C>>): Self

Returns a copy of this store with every entry of others added (overriding same-named existing ones).

open fun plus(first: Pair<String, C>, vararg others: Pair<String, C>): Self

Returns a copy of this store with first and others added (overriding same-named existing entries).

Link copied to clipboard
abstract fun setCurrent(channel: C): Self

Returns a copy of this store with CURRENT pointing to channel.

abstract fun setCurrent(alias: String): Self

Returns a copy of this store with CURRENT pointing to the channel already aliased as alias.

Link copied to clipboard
open override fun toString(): String