Package ghidra.util.datastruct
Class SizeLimitedAccumulatorWrapper<T>
java.lang.Object
ghidra.util.datastruct.SizeLimitedAccumulatorWrapper<T>
- All Implemented Interfaces:
Accumulator<T>,Iterable<T>
-
Constructor Summary
ConstructorsConstructorDescriptionSizeLimitedAccumulatorWrapper(Accumulator<T> accumulator, int maxSize) Constructor. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.util.datastruct.Accumulator
isEmpty, streamMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SizeLimitedAccumulatorWrapper
Constructor.- Parameters:
accumulator- the accumulator to pass items tomaxSize- the maximum number of items this accumulator will hold
-
-
Method Details
-
iterator
-
add
- Specified by:
addin interfaceAccumulator<T>
-
addAll
- Specified by:
addAllin interfaceAccumulator<T>
-
contains
- Specified by:
containsin interfaceAccumulator<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
-