Class SizeLimitedAccumulatorWrapper<T>

java.lang.Object
ghidra.util.datastruct.SizeLimitedAccumulatorWrapper<T>
All Implemented Interfaces:
Accumulator<T>, Iterable<T>

public class SizeLimitedAccumulatorWrapper<T> extends Object implements Accumulator<T>
  • Constructor Details

    • SizeLimitedAccumulatorWrapper

      public SizeLimitedAccumulatorWrapper(Accumulator<T> accumulator, int maxSize)
      Constructor.
      Parameters:
      accumulator - the accumulator to pass items to
      maxSize - the maximum number of items this accumulator will hold
  • Method Details

    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T>
    • 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>
    • contains

      public boolean contains(T t)
      Specified by:
      contains in interface Accumulator<T>
    • get

      public Collection<T> get()
      Specified by:
      get in interface Accumulator<T>
    • size

      public int size()
      Specified by:
      size in interface Accumulator<T>
    • hasReachedSizeLimit

      public boolean hasReachedSizeLimit()
      Returns true if this size of this accumulator is greater than or equal to the given maximum size
      Returns:
      true if the max size has been reachged