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>, Consumer<T>

public class CallbackAccumulator<T> extends Object implements Accumulator<T>
An implementation of Accumulator that allows clients to easily process items as they arrive.
  • 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

    • add

      public void add(T t)
      Specified by:
      add in interface Accumulator<T>
    • addAll

      public void addAll(Collection<T> collection)
      Specified by:
      addAll in interface Accumulator<T>
    • getProgress

      public int getProgress()
      Description copied from interface: Accumulator
      Returns the number of items that have been added to this accumulator.
      Specified by:
      getProgress in interface Accumulator<T>
      Returns:
      the number of items that have been added to this accumulator