aggregateResult method

T? aggregateResult(
  1. T? aggregate,
  2. T? nextResult
)
inherited

Aggregates the results of visiting multiple children of a node. After either all children are visited or {@link #shouldVisitNextChild} returns false, the aggregate value is returned as the result of {@link #visitChildren}.

The default implementation returns [nextResult], meaning {@link #visitChildren} will return the result of the last child visited (or return the initial value if the node has no children).

@param aggregate The previous aggregate value. In the default implementation, the aggregate value is initialized to {@link #defaultResult}, which is passed as the aggregate argument to this method after the first child node is visited. @param nextResult The result of the immediately preceeding call to visit a child node.

@return The updated aggregate result.

Implementation

T? aggregateResult(T? aggregate, T? nextResult) => nextResult;