signalByAddress method
- OccurrenceAddress address
Find a signal by its OccurrenceAddress.
The parent portion of address navigates to the owning occurrence;
the last index selects the signal within that occurrence. O(depth).
Implementation
SignalOccurrence? signalByAddress(OccurrenceAddress address) {
if (address.path.isEmpty) {
return null;
}
final node = occurrenceByAddress(
OccurrenceAddress(address.path.sublist(0, address.path.length - 1)));
final sigIdx = address.path.last;
return (node != null && sigIdx >= 0 && sigIdx < node.signals.length)
? node.signals[sigIdx]
: null;
}