Package ghidra.program.database.map
Class AddressKeyRecordIterator
- java.lang.Object
-
- ghidra.program.database.map.AddressKeyRecordIterator
-
- All Implemented Interfaces:
RecordIterator
public class AddressKeyRecordIterator extends java.lang.Object implements RecordIterator
Returns a RecordIterator over records that are address keyed. Various constructors allow the iterator to be restricted to an address range or address set and optionally to be positioned at some starting address.
-
-
Constructor Summary
Constructors Constructor Description AddressKeyRecordIterator(Table table, AddressMap addrMap)
Construcs a new AddressKeyRecordIterator that iterates over all records in ascending order.AddressKeyRecordIterator(Table table, AddressMap addrMap, Address startAddr, boolean before)
Construcs a new AddressKeyRecordIterator that iterates over records starting at given start address.AddressKeyRecordIterator(Table table, AddressMap addrMap, Address minAddr, Address maxAddr, Address startAddr, boolean before)
Constructs a new AddressKeyRecordIterator that iterates over records that are within an address range with an optional start address within that range.AddressKeyRecordIterator(Table table, AddressMap addrMap, AddressSetView set, Address startAddr, boolean before)
Construcs a new AddressKeyRecordIterator that iterates over records that are contained in an address set with an optional start address within that set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete()
Delete the last Record read via the next or previous methods.boolean
hasNext()
Return true if a Record is available in the forward direction.boolean
hasPrevious()
Return true if a Record is available in the reverse directionjava.util.Iterator<DBRecord>
iterator()
DBRecord
next()
Return the nexy Record or null if one is not available.DBRecord
previous()
Return the previous Record or null if one is not available.
-
-
-
Constructor Detail
-
AddressKeyRecordIterator
public AddressKeyRecordIterator(Table table, AddressMap addrMap) throws java.io.IOException
Construcs a new AddressKeyRecordIterator that iterates over all records in ascending order. Memory addresses encoded as Absolute are not included.- Parameters:
table
- the table to iterate.addrMap
- the address map- Throws:
java.io.IOException
- if a database io error occurs.
-
AddressKeyRecordIterator
public AddressKeyRecordIterator(Table table, AddressMap addrMap, Address startAddr, boolean before) throws java.io.IOException
Construcs a new AddressKeyRecordIterator that iterates over records starting at given start address. Memory addresses encoded as Absolute are not included.- Parameters:
table
- the table to iterate.addrMap
- the address mapstartAddr
- the address at which to position the iterator. The iterator will be positioned either before or after the start address depending on the before parameter.before
- if true, the iterator will be positioned before the start address, otherwise it will be positioned after the start address.- Throws:
java.io.IOException
- if a database io error occurs.
-
AddressKeyRecordIterator
public AddressKeyRecordIterator(Table table, AddressMap addrMap, Address minAddr, Address maxAddr, Address startAddr, boolean before) throws java.io.IOException
Constructs a new AddressKeyRecordIterator that iterates over records that are within an address range with an optional start address within that range. Memory addresses encoded as Absolute are not included.- Parameters:
table
- the table to iterate.addrMap
- the address mapminAddr
- the minimum address in the range.maxAddr
- tha maximum address in the range.startAddr
- the address at which to position the iterator. The iterator will be positioned either before or after the start address depending on the before parameter. If this parameter is null, then the iterator will start either before the min address or after the max address depending on the before parameter.before
- if true, the iterator will be positioned before the start address, otherwise it will be positioned after the start address. If the start address is null, then if the before parameter is true, the iterator is positioned before the min. Otherwise the iterator is positioned after the max address.- Throws:
java.io.IOException
- if a database io error occurs.
-
AddressKeyRecordIterator
public AddressKeyRecordIterator(Table table, AddressMap addrMap, AddressSetView set, Address startAddr, boolean before) throws java.io.IOException
Construcs a new AddressKeyRecordIterator that iterates over records that are contained in an address set with an optional start address within that set. Memory addresses encoded as Absolute are not included.- Parameters:
table
- the table to iterate.addrMap
- the address mapset
- the address set to iterate over.startAddr
- the address at which to position the iterator. The iterator will be positioned either before or after the start address depending on the before parameter. If this parameter is null, then the iterator will start either before the min address or after the max address depending on the before parameter.before
- if true, the iterator will be positioned before the start address, otherwise it will be positioned after the start address. If the start address is null, then if the before parameter is true, the iterator is positioned before the min. Otherwise the iterator is postioned after the max address.- Throws:
java.io.IOException
- if a database io error occurs.
-
-
Method Detail
-
hasNext
public boolean hasNext() throws java.io.IOException
Description copied from interface:RecordIterator
Return true if a Record is available in the forward direction.- Specified by:
hasNext
in interfaceRecordIterator
- Throws:
java.io.IOException
- thrown if an IO error occurs- See Also:
RecordIterator.hasNext()
-
hasPrevious
public boolean hasPrevious() throws java.io.IOException
Description copied from interface:RecordIterator
Return true if a Record is available in the reverse direction- Specified by:
hasPrevious
in interfaceRecordIterator
- Throws:
java.io.IOException
- thrown if an IO error occurs- See Also:
RecordIterator.hasPrevious()
-
next
public DBRecord next() throws java.io.IOException
Description copied from interface:RecordIterator
Return the nexy Record or null if one is not available.- Specified by:
next
in interfaceRecordIterator
- Throws:
java.io.IOException
- thrown if an IO error occurs- See Also:
RecordIterator.next()
-
previous
public DBRecord previous() throws java.io.IOException
Description copied from interface:RecordIterator
Return the previous Record or null if one is not available.- Specified by:
previous
in interfaceRecordIterator
- Throws:
java.io.IOException
- thrown if an IO error occurs- See Also:
RecordIterator.previous()
-
delete
public boolean delete() throws java.io.IOException
Description copied from interface:RecordIterator
Delete the last Record read via the next or previous methods.- Specified by:
delete
in interfaceRecordIterator
- Returns:
- true if record was successfully deleted.
- Throws:
java.io.IOException
- thrown if an IO error occurs.- See Also:
RecordIterator.delete()
-
iterator
public java.util.Iterator<DBRecord> iterator()
-
-