Package ghidra.program.database.map
Class AddressKeyIterator
- java.lang.Object
-
- ghidra.program.database.map.AddressKeyIterator
-
- All Implemented Interfaces:
DBLongIterator
public class AddressKeyIterator extends java.lang.Object implements DBLongIterator
Iterator of primary keys that are addresses. The longs returned are the address longs.
-
-
Constructor Summary
Constructors Constructor Description AddressKeyIterator()
Constructs an empty iterator.AddressKeyIterator(Table table, AddressMap addrMap, boolean before)
Constructs new AddressKeyIterator that iterates over all addresses.AddressKeyIterator(Table table, AddressMap addrMap, Address startAddr, boolean before)
Constructs new AddressKeyIterator that iterates overal all addresses and is initially positioned at startAddr.AddressKeyIterator(Table table, AddressMap addrMap, Address minAddr, Address maxAddr, Address startAddr, boolean before)
Constructs new AddressKeyIterator that iterates over an address range.AddressKeyIterator(Table table, AddressMap addrMap, AddressSetView set, Address startAddr, boolean before)
Constructs new AddressKeyIterator to iterate over an address set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete()
Delete the last record(s) associated with the last value read via the next or previous methods.boolean
hasNext()
Return true if a value is available in the forward direction.boolean
hasPrevious()
Return true if a value is available in the reverse directionlong
next()
Return the next long value.long
previous()
Return the previous long value.
-
-
-
Constructor Detail
-
AddressKeyIterator
public AddressKeyIterator()
Constructs an empty iterator.
-
AddressKeyIterator
public AddressKeyIterator(Table table, AddressMap addrMap, boolean before) throws java.io.IOException
Constructs new AddressKeyIterator that iterates over all addresses. Memory addresses encoded as Absolute are not included.- Parameters:
table
- the database table key by addressesaddrMap
- the address mapbefore
- positions the iterator before the min value,otherwise after the max value.- Throws:
java.io.IOException
- if a database error occurs.
-
AddressKeyIterator
public AddressKeyIterator(Table table, AddressMap addrMap, Address startAddr, boolean before) throws java.io.IOException
Constructs new AddressKeyIterator that iterates overal all addresses and is initially positioned at startAddr. Memory addresses encoded as Absolute are not included.- Parameters:
table
- the database table key by addressesaddrMap
- the address mapstartAddr
- the address at which to position the iterator.before
- positions the iterator before the start address,otherwise after the start address. If the start address is null, then before positions the iterator before the lowest address, !before positions the iterater after the largest address.- Throws:
java.io.IOException
- if a database error occurs.
-
AddressKeyIterator
public AddressKeyIterator(Table table, AddressMap addrMap, Address minAddr, Address maxAddr, Address startAddr, boolean before) throws java.io.IOException
Constructs new AddressKeyIterator that iterates over an address range. Memory addresses encoded as Absolute are not included.- Parameters:
table
- the database table key by addressesaddrMap
- the address mapminAddr
- the first address in the range.maxAddr
- the last address in the range.startAddr
- the address at which to position the iterator, can be null. The exact position of the iterator depends on the before parameter.before
- positions the iterator before the start address,otherwise after the start address. If the start address is null, then before positions the iterator before the lowest address, !before positions the iterater after the largest address.- Throws:
java.io.IOException
- if a database error occurs.
-
AddressKeyIterator
public AddressKeyIterator(Table table, AddressMap addrMap, AddressSetView set, Address startAddr, boolean before) throws java.io.IOException
Constructs new AddressKeyIterator to iterate over an address set. Memory addresses encoded as Absolute are not included.- Parameters:
table
- the database table key by addressesaddrMap
- the address mapset
- the address set to iterator overstartAddr
- the address at which to position the iterator, can be null. The exact position of the iterator depends on the before parameter.before
- positions the iterator before the start address,otherwise after the start address. If the start address is null, then before positions the iterator before the lowest address, !before positions the iterater after the largest address.- Throws:
java.io.IOException
- if a database error occurs.
-
-
Method Detail
-
hasNext
public boolean hasNext() throws java.io.IOException
Description copied from interface:DBLongIterator
Return true if a value is available in the forward direction.- Specified by:
hasNext
in interfaceDBLongIterator
- Throws:
java.io.IOException
- thrown if an IO error occurs- See Also:
DBLongIterator.hasNext()
-
hasPrevious
public boolean hasPrevious() throws java.io.IOException
Description copied from interface:DBLongIterator
Return true if a value is available in the reverse direction- Specified by:
hasPrevious
in interfaceDBLongIterator
- Throws:
java.io.IOException
- thrown if an IO error occurs- See Also:
DBLongIterator.hasPrevious()
-
next
public long next() throws java.io.IOException
Description copied from interface:DBLongIterator
Return the next long value.- Specified by:
next
in interfaceDBLongIterator
- Throws:
java.io.IOException
- thrown if an IO error occurs- See Also:
DBLongIterator.next()
-
previous
public long previous() throws java.io.IOException
Description copied from interface:DBLongIterator
Return the previous long value.- Specified by:
previous
in interfaceDBLongIterator
- Throws:
java.io.IOException
- thrown if an IO error occurs- See Also:
DBLongIterator.previous()
-
delete
public boolean delete() throws java.io.IOException
Description copied from interface:DBLongIterator
Delete the last record(s) associated with the last value read via the next or previous methods.- Specified by:
delete
in interfaceDBLongIterator
- Returns:
- true if record(s) was successfully deleted.
- Throws:
java.io.IOException
- thrown if an IO error occurs.- See Also:
DBLongIterator.delete()
-
-