MetadataLookup class final
Provides fast, structured access to constantIndex, functionIndex, and typeIndex within a MetadataIndex, enabling efficient lookup by namespace and name or by name alone.
Constructors
- MetadataLookup(MetadataIndex index)
-
Creates a new MetadataLookup from a MetadataIndex.
factory
Properties
-
constantIndex
→ HashMap<
String, HashMap< String, Field> > -
A map of Fields indexed by their namespace and name.
final
-
functionIndex
→ HashMap<
String, HashMap< String, MethodDef> > -
A map of MethodDefs indexed by their namespace and name.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → MetadataIndex
-
The underlying MetadataIndex from which this lookup was created.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
typeIndex
→ HashMap<
String, HashMap< String, List< >TypeDef> > -
A map of TypeDefs indexed by their namespace and name.
final
Methods
-
findConstant(
String namespace, String name) → Field -
Finds a constant by its
namespaceandname. -
findConstantByName(
String name) → Field -
Finds a constant by its
nameacross all namespaces. -
findFunction(
String namespace, String name) → MethodDef -
Finds a function by its
namespaceandname. -
findFunctionByName(
String name) → MethodDef -
Finds a function by its
nameacross all namespaces. -
findSingleType(
String namespace, String name) → TypeDef -
Finds a single TypeDef matching the given
namespaceandname. -
findSingleTypeByName(
String name) → TypeDef -
Finds a single TypeDef matching the given
nameacross all namespaces. -
findTypes(
String namespace, String name) → Iterable< TypeDef> -
Enumerates all TypeDef instances matching the given
namespaceandname. -
findTypesByName(
String name) → Iterable< TypeDef> -
Finds all TypeDef instances matching the
nameacross all namespaces. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
tryFindConstant(
String namespace, String name) → Field? -
Attempts to find a constant by its
namespaceandname. -
tryFindConstantByName(
String name) → Field? -
Attempts to find a constant by its
nameacross all namespaces. -
tryFindFunction(
String namespace, String name) → MethodDef? -
Attempts to find a function by its
namespaceandname. -
tryFindFunctionByName(
String name) → MethodDef? -
Attempts to find a function by its
nameacross all namespaces. -
tryFindSingleType(
String namespace, String name) → TypeDef? -
Attempts to find a single TypeDef matching the given
namespaceandname. -
tryFindSingleTypeByName(
String name) → TypeDef? -
Attempts to find a single TypeDef matching the given
nameacross all namespaces.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited