OccurrenceAddress class

Efficient hierarchical address using indices instead of strings.

Format: index0, index1, ... or [] for root. Example: 0, 2, 4 means root's 0th child, then 2nd child of that, then the 4th child (occurrence) or 4th signal, depending on context.

Advantages:

  • O(1) address creation (just append index)
  • O(depth) tree navigation (direct array indexing)
  • Deterministic serialization (no parsing needed)
  • Natural alignment with waveform dictionary (integer indices)
  • Supports hierarchical queries (ancestor matching, batching by prefix)

This replaces string-based path lookups with typed, semantic addressing.

Annotations

Constructors

OccurrenceAddress(List<int> path)
Create a hierarchy address from a path list.
const
OccurrenceAddress.fromDotString(String s)
Deserialize from a dot-separated string produced by toDotString.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
path List<int>
Path through tree as indices stored as immutable list. Empty list represents the root occurrence. Non-empty list: indices navigate through the hierarchy. The last index refers to either a child occurrence or a signal, depending on context.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

child(int childIndex) OccurrenceAddress
Create a child address by appending an occurrence index. Use this when navigating to a child occurrence.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
signal(int signalIndex) OccurrenceAddress
Create a signal address by appending signal index. Use this when addressing a signal within current occurrence.
toDotString() String
Serialize to a dot-separated string suitable for use as a JSON key.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

tryFromPathname(String pathname, HierarchyOccurrence root) OccurrenceAddress?
Resolve a pathname string (e.g. "Top/counter/clk" or "Top.counter.clk") to a OccurrenceAddress by walking root.

Constants

root → const OccurrenceAddress
Root address (empty path).