mixin

SpecMap

@Js
const mixin SpecMap

SpecMap is a map of named Specs

NOTE: in most cases name keys match the Spec.name of slot specs themselves. However, in cases where the slot name is an auto-name of "_0", "_1", etc its possible that the slot name keys do not match their slot names. This occurs when inheriting auto-named slots. The spec names are assigned uniquely per type, but when merged by inheritance might be assigned new unique names. This often occurs in queries such as point queries.

methods toStr

Debug string

getAll

Get all the specs by name if there are naming collisions

names

Convenience to list the spec names in this map

get

Get the spec keyed by given name

isEmpty

Return if slots are empty

missing

Return if the given name is undefined

has

Return if the given name is defined

list

List the specs

eachWhile

Iterate through the specs until function returns non-null

getQualified

Get the spec using its qualified name

each

Iterate through the specs with name key

empty

Empty spec map

each abstract Void each(|Spec,Str| f)

Iterate through the specs with name key. If there are collisions with the same name they are iterated individually. NOTE: the name parameter may not match slots names

eachWhile abstract Obj? eachWhile(|Spec,Str->Obj?| f)

Iterate through the specs until function returns non-null. If there are collisions with the same name they are iterated individually. NOTE: the name parameter may not match slots names

empty static SpecMap empty()

Empty spec map

get abstract Spec? get(Str name, Bool checked)

Get the spec keyed by given name. If there are naming collisions for the name then raise AmbiguousSpecErr regardless of checked flag. NOTE: the name key may not match slot name

getAll abstract Spec[] getAll(Str name)

Get all the specs by name if there are naming collisions. If no collisions return a list of one item, and if name is not mapped return empty list.

getQualified abstract Spec? getQualified(Str qname, Bool checked)

Get the spec using its qualified name. If the spec is not found or has different qname then return null or raise exception based on the checked flag.

has abstract Bool has(Str name)

Return if the given name is defined.

isEmpty abstract Bool isEmpty()

Return if slots are empty

list abstract Spec[] list()

List the specs; prefer each NOTE: the names may not match slots names

missing abstract Bool missing(Str name)

Return if the given name is undefined.

names abstract Str[] names()

Convenience to list the spec names in this map; prefer each. NOTE: the names may not match slots names

toStr virtual Str toStr()

Debug string

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST