Class SetAccumulatorWrapper<T>

java.lang.Object
ghidra.util.datastruct.SetAccumulatorWrapper<T>
Type Parameters:
T - the type
All Implemented Interfaces:
Accumulator<T>, Consumer<T>

public class SetAccumulatorWrapper<T> extends Object implements Accumulator<T>
An accumulator that will only pass on unique items to the wrapped accumulator. This class uses a concurrent set, which means that the data will be copied in this accumulator while it is being used.
  • Constructor Details

    • SetAccumulatorWrapper

      public SetAccumulatorWrapper(Accumulator<T> accumulator)
  • 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
    • asSet

      public Set<T> asSet()
      Returns the internal Set used by this class. This should only be called when the data is finished loading.
      Returns:
      the set