Package ghidra.util.datastruct
Class FilteringAccumulatorWrapper<T>
- java.lang.Object
-
- ghidra.util.datastruct.FilteringAccumulatorWrapper<T>
-
- Type Parameters:
T
- the type of the accumulator
- All Implemented Interfaces:
Accumulator<T>
,java.lang.Iterable<T>
public class FilteringAccumulatorWrapper<T> extends java.lang.Object implements Accumulator<T>
A class that allows clients to wrap a given accumulator, only adding elements that pass the given filter.
-
-
Constructor Summary
Constructors Constructor Description FilteringAccumulatorWrapper(Accumulator<T> accumulator, java.util.function.Predicate<T> passesFilterPredicate)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(T t)
void
addAll(java.util.Collection<T> collection)
boolean
contains(T t)
java.util.Collection<T>
get()
java.util.Iterator<T>
iterator()
int
size()
-
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
-
FilteringAccumulatorWrapper
public FilteringAccumulatorWrapper(Accumulator<T> accumulator, java.util.function.Predicate<T> passesFilterPredicate)
Constructor.- Parameters:
accumulator
- the accumulator to pass items topassesFilterPredicate
- the predicate that will return true for items that should be allowed to pass
-
-
Method Detail
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<T>
-
add
public void add(T t)
- Specified by:
add
in interfaceAccumulator<T>
-
addAll
public void addAll(java.util.Collection<T> collection)
- Specified by:
addAll
in interfaceAccumulator<T>
-
contains
public boolean contains(T t)
- Specified by:
contains
in interfaceAccumulator<T>
-
get
public java.util.Collection<T> get()
- Specified by:
get
in interfaceAccumulator<T>
-
size
public int size()
- Specified by:
size
in interfaceAccumulator<T>
-
-