Package ghidra.util.datastruct
Class CallbackAccumulator<T>
java.lang.Object
ghidra.util.datastruct.CallbackAccumulator<T>
- Type Parameters:
T
- the type of the item being accumulated
- All Implemented Interfaces:
Accumulator<T>
,Iterable<T>
An implementation of
Accumulator
that allows clients to easily process items as
they arrive.
This class is different than normal accumulators in that the values are not
stored internally. As such, calls to get()
, iterator()
and
size()
will reflect having no data.
-
Constructor Summary
-
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
-
CallbackAccumulator
Constructor- Parameters:
consumer
- the consumer that will get called each time an item is added
-
-
Method Details
-
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>
-
iterator
-
size
public int size()- Specified by:
size
in interfaceAccumulator<T>
-