Class DefinedDataIterator
java.lang.Object
ghidra.program.util.DefinedDataIterator
- All Implemented Interfaces:
DataIterator, Iterable<Data>, Iterator<Data>
Iterator that visits each defined data instance in the initialized memory of a Program or in the footprint of
a specified data element.
Data elements that are nested inside of composites or arrays are visited, not just the parent/containing data element.
Not thread safe.
-
Nested Class Summary
Nested classes/interfaces inherited from interface DataIterator
DataIterator.IteratorWrapper -
Field Summary
Fields inherited from interface DataIterator
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionstatic DefinedDataIteratorbyDataInstance(Program program, Predicate<Data> dataInstancePredicate) Creates a new iterator that traverses the entire Program's address space, returning data instances that successfully match the predicate.static DefinedDataIteratorbyDataType(Program program, AddressSetView addresses, Predicate<DataType> dataTypePredicate) Creates a new iterator that traverses a portion of the Program's address space, returning data instances that successfully match the predicate.static DefinedDataIteratorbyDataType(Program program, Predicate<DataType> dataTypePredicate) Creates a new iterator that traverses the entire Program's address space, returning data instances that successfully match the predicate.booleanhasNext()next()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DataIterator
iteratorMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface Iterator
forEachRemaining, remove
-
Method Details
-
byDataType
public static DefinedDataIterator byDataType(Program program, Predicate<DataType> dataTypePredicate) Creates a new iterator that traverses the entire Program's address space, returning data instances that successfully match the predicate. -
byDataType
public static DefinedDataIterator byDataType(Program program, AddressSetView addresses, Predicate<DataType> dataTypePredicate) Creates a new iterator that traverses a portion of the Program's address space, returning data instances that successfully match the predicate. -
byDataInstance
public static DefinedDataIterator byDataInstance(Program program, Predicate<Data> dataInstancePredicate) Creates a new iterator that traverses the entire Program's address space, returning data instances that successfully match the predicate.- Parameters:
program- Program to searchdataInstancePredicate-Predicatethat tests each data instance's properties- Returns:
- new iterator
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceDataIterator- Specified by:
hasNextin interfaceIterator<Data>
-
next
-