Scope

class Scope(entries: HashMap<Scope.Key<*>, Any>)

Contains any type of data which consists of a Key and a corresponding value object.

Constructors

Scope
Link copied to clipboard
js
fun Scope(parent: Scope)
Creates a new Scope instance from a given one.
Scope
Link copied to clipboard
js
fun Scope(entries: HashMap<Scope.Key<*>, Any> = hashMapOf())

Types

Key
Link copied to clipboard
js
open class Key<T : Any>(name: String)
Key for setting and receiving entries in the Scope

Functions

contains
Link copied to clipboard
js
fun <T : Any> contains(key: Scope.Key<T>): Boolean
Checks if the Scope contains the given key.
get
Link copied to clipboard
js
operator fun <T : Any> get(key: Scope.Key<T>): T?
Receives a key-value-par from the Scope.
iterator
Link copied to clipboard
js
operator fun iterator(): Iterator<Map.Entry<Scope.Key<*>, Any>>
Returns an Iterator over the entries in the Scope.
remove
Link copied to clipboard
js
fun <T : Any> remove(key: Scope.Key<T>): Any?
Removes the specified key and its corresponding value from the Scope.
toString
Link copied to clipboard
js
open override fun toString(): String
Formats the Scope to a valid JSON string for printing or using it inside Javascript.

Properties

keys
Link copied to clipboard
js
val keys: Set<Scope.Key<*>>
Returns all containing Keys from the Scope.
size
Link copied to clipboard
js
val size: Int
Gives the number of stored key-value-pairs.