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.
Debug string
Get all the specs by name if there are naming collisions
Convenience to list the spec names in this map
Get the spec keyed by given name
Return if slots are empty
Return if the given name is undefined
Return if the given name is defined
List the specs
Iterate through the specs until function returns non-null
Get the spec using its qualified name
Iterate through the specs with name key
Empty spec map
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
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
static SpecMap empty()
Empty spec map
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
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.
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.
abstract Bool has(Str name)
Return if the given name is defined.
abstract Bool isEmpty()
Return if slots are empty
abstract Spec[] list()
List the specs; prefer each NOTE: the names may not match slots names
abstract Bool missing(Str name)
Return if the given name is undefined.
abstract Str[] names()
Convenience to list the spec names in this map; prefer each. NOTE: the names may not match slots names
virtual Str toStr()
Debug string