Package ghidra.util.datastruct
Class SizeLimitedAccumulatorWrapper<T>
java.lang.Object
ghidra.util.datastruct.SizeLimitedAccumulatorWrapper<T>
- All Implemented Interfaces:
Accumulator<T>
,Iterable<T>
-
Constructor Summary
ConstructorDescriptionSizeLimitedAccumulatorWrapper
(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, wait
Methods inherited from interface ghidra.util.datastruct.Accumulator
isEmpty, stream
Methods 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:
add
in interfaceAccumulator<T>
-
addAll
- Specified by:
addAll
in interfaceAccumulator<T>
-
contains
- Specified by:
contains
in interfaceAccumulator<T>
-
get
- Specified by:
get
in interfaceAccumulator<T>
-
size
public int size()- Specified by:
size
in 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
-