Class CallbackAccumulator<T>

java.lang.Object
ghidra.util.datastruct.CallbackAccumulator<T>
Type Parameters:
T - the type of the item being accumulated
All Implemented Interfaces:
Accumulator<T>, Iterable<T>

public class CallbackAccumulator<T> extends Object implements Accumulator<T>
An implementation of Accumulator that allows clients to easily process items as they arrive.

This class is different than normal accumulators in that the values are not stored internally. As such, calls to get(), iterator() and size() will reflect having no data.

  • Constructor Details

    • CallbackAccumulator

      public CallbackAccumulator(Consumer<T> consumer)
      Constructor
      Parameters:
      consumer - the consumer that will get called each time an item is added
  • Method Details