collectEvents

Collect all events of the expected type (set during construction) starting with the top event on the event source. Collection stops as soon as a non comment or comment of the unexpected type is encountered.


fun collectEvents(event: Event?): Event?

Collect all events of the expected type (set during construction) starting with event provided as an argument and continuing with the top event on the event source. Collection stops as soon as a non comment or comment of the unexpected type is encountered.

Return

the event provided as an argument, if it is not collected; Otherwise, null

Parameters

event

the first event to attempt to collect.