Package ghidra.util.datastruct
Class SizeLimitedAccumulatorWrapper<T>
- java.lang.Object
-
- ghidra.util.datastruct.SizeLimitedAccumulatorWrapper<T>
-
- All Implemented Interfaces:
Accumulator<T>,java.lang.Iterable<T>
public class SizeLimitedAccumulatorWrapper<T> extends java.lang.Object implements Accumulator<T>
-
-
Constructor Summary
Constructors Constructor Description SizeLimitedAccumulatorWrapper(Accumulator<T> accumulator, int maxSize)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(T t)voidaddAll(java.util.Collection<T> collection)booleancontains(T t)java.util.Collection<T>get()booleanhasReachedSizeLimit()Returns true if this size of this accumulator is greater than or equal to the given maximum sizejava.util.Iterator<T>iterator()intsize()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ghidra.util.datastruct.Accumulator
isEmpty, stream
-
-
-
-
Constructor Detail
-
SizeLimitedAccumulatorWrapper
public SizeLimitedAccumulatorWrapper(Accumulator<T> accumulator, int maxSize)
Constructor.- Parameters:
accumulator- the accumulator to pass items tomaxSize- the maximum number of items this accumulator will hold
-
-
Method Detail
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<T>
-
add
public void add(T t)
- Specified by:
addin interfaceAccumulator<T>
-
addAll
public void addAll(java.util.Collection<T> collection)
- Specified by:
addAllin interfaceAccumulator<T>
-
contains
public boolean contains(T t)
- Specified by:
containsin interfaceAccumulator<T>
-
get
public java.util.Collection<T> get()
- Specified by:
getin interfaceAccumulator<T>
-
size
public int size()
- Specified by:
sizein interfaceAccumulator<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
-
-