Class ListAccumulator<T>

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

public class ListAccumulator<T> extends Object implements Accumulator<T>, Iterable<T>
An accumulator backed by a thread safe list. This class has methods to retrieve the data once all loading has finished.

API uses of the accumulator are inherently multi-threaded. The list in this class is synchronized so that the data in the accumulator will be visible to the client thread.

  • Constructor Details

    • ListAccumulator

      public ListAccumulator()
  • 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
    • contains

      public boolean contains(T t)
    • get

      public Collection<T> get()
    • asList

      public List<T> asList()
    • size

      public int size()
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • stream

      public Stream<T> stream()
    • toString

      public String toString()
      Overrides:
      toString in class Object