Class DBTraceObjectValueMapAddressSetView
- All Implemented Interfaces:
AddressSetView,Iterable<AddressRange>
-
Constructor Summary
ConstructorsConstructorDescriptionDBTraceObjectValueMapAddressSetView(AddressFactory factory, ReadWriteLock lock, SpatialMap<ValueShape, DBTraceObjectValueData, TraceObjectValueQuery> map, Predicate<? super DBTraceObjectValueData> predicate) An address set view that unions all addresses where an entry satisfying the given predicate exists. -
Method Summary
Modifier and TypeMethodDescriptionbooleanTest if the address is contained within this set.booleanTest if the given address range is contained in this set.booleancontains(AddressSetView rangeSet) Test if the given address set is a subset of this set.protected AddressRangeIteratordoGetAddressRanges(DBCachedObjectStoreFactory.RecAddress start, DBCachedObjectStoreFactory.RecAddress end, boolean forward) Finds the first address in this collection that is also in the given addressSet.getAddressRanges(boolean forward) Returns an iterator over the ranges in the specified ordergetAddressRanges(Address start, boolean forward) Returns an iterator of address ranges starting with the range that contains the given address.Returns the first range in this set or null if the set is emptyReturns the last range in this set or null if the set is emptyGet the maximum address for this address set.Get the minimum address for this address set.longintgetRangeContaining(Address address) Returns the range that contains the given addressbooleanReturns true if the given address set contains the same set of addresses as this set.intersect(AddressSetView view) Computes the intersection of this address set with the given address set.intersectRange(Address start, Address end) Computes the intersection of this address set with the given address range.booleanintersects(Address start, Address end) Determine if the start and end range intersects with the specified address set.booleanintersects(AddressSetView addrSet) Determine if this address set intersects with the specified address set.booleanisEmpty()subtract(AddressSetView addrSet) Computes the difference of this address set with the given address set (this - set).union(AddressSetView addrSet) Computes the union of this address set with the given address set.xor(AddressSetView addrSet) Computes the exclusive-or of this address set with the given set.Methods inherited from class ghidra.util.AbstractAddressSetView
fixStart, getAddresses, getAddresses, iterator, iterator, iteratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ghidra.program.model.address.AddressSetView
getAddressCountBefore, spliterator, spliterator, spliterator, stream, stream, stream
-
Constructor Details
-
DBTraceObjectValueMapAddressSetView
public DBTraceObjectValueMapAddressSetView(AddressFactory factory, ReadWriteLock lock, SpatialMap<ValueShape, DBTraceObjectValueData, TraceObjectValueQuery> map, Predicate<? super DBTraceObjectValueData> predicate) An address set view that unions all addresses where an entry satisfying the given predicate exists.The caller may reduce the map given to this view. Reduction is preferable to using a predicate, where possible, because reduction benefits from the index.
- Parameters:
factory- the trace's address factorylock- the lock on the databasemap- the mappredicate- a predicate to further filter entries
-
-
Method Details
-
contains
Description copied from interface:AddressSetViewTest if the address is contained within this set.- Parameters:
addr- address to test.- Returns:
- true if addr exists in the set, false otherwise.
-
contains
Description copied from interface:AddressSetViewTest if the given address range is contained in this set.The specified start and end addresses must form a valid range within a single
AddressSpace.- Specified by:
containsin interfaceAddressSetView- Overrides:
containsin classAbstractAddressSetView- Parameters:
start- the first address in the range.end- the last address in the range.- Returns:
- true if entire range is contained within the set, false otherwise.
-
contains
Description copied from interface:AddressSetViewTest if the given address set is a subset of this set.- Specified by:
containsin interfaceAddressSetView- Overrides:
containsin classAbstractAddressSetView- Parameters:
rangeSet- the set to test.- Returns:
- true if the entire set is contained within this set, false otherwise.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceAddressSetView- Overrides:
isEmptyin classAbstractAddressSetView- Returns:
- true if this set is empty.
-
getMinAddress
Description copied from interface:AddressSetViewGet the minimum address for this address set.NOTE: An
AddressRangeshould generally not be formed using this address andAddressSetView.getMaxAddress()since it may span multipleAddressSpaces.- Specified by:
getMinAddressin interfaceAddressSetView- Overrides:
getMinAddressin classAbstractAddressSetView- Returns:
- the minimum address for this set. Returns null if the set is empty.
-
getMaxAddress
Description copied from interface:AddressSetViewGet the maximum address for this address set.NOTE: An
AddressRangeshould generally not be formed using this address andAddressSetView.getMaxAddress()since it may span multipleAddressSpaces.- Specified by:
getMaxAddressin interfaceAddressSetView- Overrides:
getMaxAddressin classAbstractAddressSetView- Returns:
- the maximum address for this set. Returns null if the set is empty.
-
getNumAddressRanges
public int getNumAddressRanges()- Specified by:
getNumAddressRangesin interfaceAddressSetView- Overrides:
getNumAddressRangesin classAbstractAddressSetView- Returns:
- the number of address ranges in this set.
-
getAddressRanges
- Returns:
- an iterator over the address ranges in this address set.
-
getAddressRanges
Description copied from interface:AddressSetViewReturns an iterator over the ranges in the specified order- Parameters:
forward- the ranges are returned from lowest to highest, otherwise from highest to lowest- Returns:
- an iterator over all the addresse ranges in the set.
-
doGetAddressRanges
protected AddressRangeIterator doGetAddressRanges(DBCachedObjectStoreFactory.RecAddress start, DBCachedObjectStoreFactory.RecAddress end, boolean forward) -
getAddressRanges
Returns an iterator of address ranges starting with the range that contains the given address.If there is no range containing the start address, then the first range will be the next range greater than the start address if going forward, otherwise the range less than the start address
Note the first range may be incomplete up when composed of connected entries, but it will at least include all the ranges ahead of the given start -- or behind the given start if forward is false. TODO: Fix that, just like
UnionAddressSetView?- Parameters:
start- the address the first range should contain.forward- true iterators forward, false backwards- Returns:
- the AddressRange iterator
-
getNumAddresses
public long getNumAddresses()- Specified by:
getNumAddressesin interfaceAddressSetView- Overrides:
getNumAddressesin classAbstractAddressSetView- Returns:
- the number of addresses in this set.
-
intersects
Description copied from interface:AddressSetViewDetermine if this address set intersects with the specified address set.- Specified by:
intersectsin interfaceAddressSetView- Overrides:
intersectsin classAbstractAddressSetView- Parameters:
addrSet- address set to check intersection with.- Returns:
- true if this set intersects the specified addrSet else false
-
intersects
Description copied from interface:AddressSetViewDetermine if the start and end range intersects with the specified address set.The specified start and end addresses must form a valid range within a single
AddressSpace.- Specified by:
intersectsin interfaceAddressSetView- Overrides:
intersectsin classAbstractAddressSetView- Parameters:
start- start of rangeend- end of range- Returns:
- true if the given range intersects this address set.
-
intersect
Description copied from interface:AddressSetViewComputes the intersection of this address set with the given address set.This method does not modify this address set.
- Specified by:
intersectin interfaceAddressSetView- Overrides:
intersectin classAbstractAddressSetView- Parameters:
view- the address set to intersect with.- Returns:
- AddressSet a new address set that contains all addresses that are contained in both this set and the given set.
-
intersectRange
Description copied from interface:AddressSetViewComputes the intersection of this address set with the given address range.This method does not modify this address set. The specified start and end addresses must form a valid range within a single
AddressSpace.- Specified by:
intersectRangein interfaceAddressSetView- Overrides:
intersectRangein classAbstractAddressSetView- Parameters:
start- start of rangeend- end of range- Returns:
- AddressSet a new address set that contains all addresses that are contained in both this set and the given range.
-
union
Description copied from interface:AddressSetViewComputes the union of this address set with the given address set.This method does not change this address set.
- Specified by:
unionin interfaceAddressSetView- Overrides:
unionin classAbstractAddressSetView- Parameters:
addrSet- The address set to be unioned with this address set.- Returns:
- AddressSet A new address set which contains all the addresses from both this set and the given set.
-
subtract
Description copied from interface:AddressSetViewComputes the difference of this address set with the given address set (this - set).Note that this is not the same as (set - this). This method does not change this address set.
- Specified by:
subtractin interfaceAddressSetView- Overrides:
subtractin classAbstractAddressSetView- Parameters:
addrSet- the set to subtract from this set.- Returns:
- AddressSet a new address set which contains all the addresses that are in this set, but not in the given set.
-
xor
Description copied from interface:AddressSetViewComputes the exclusive-or of this address set with the given set.This method does not modify this address set.
- Specified by:
xorin interfaceAddressSetView- Overrides:
xorin classAbstractAddressSetView- Parameters:
addrSet- address set to exclusive-or with.- Returns:
- AddressSet a new address set containing all addresses that are in either this set or the given set, but not in both sets
-
hasSameAddresses
Description copied from interface:AddressSetViewReturns true if the given address set contains the same set of addresses as this set.- Specified by:
hasSameAddressesin interfaceAddressSetView- Overrides:
hasSameAddressesin classAbstractAddressSetView- Parameters:
view- the address set to compare.- Returns:
- true if the given set contains the same addresses as this set.
-
getFirstRange
Description copied from interface:AddressSetViewReturns the first range in this set or null if the set is empty- Specified by:
getFirstRangein interfaceAddressSetView- Overrides:
getFirstRangein classAbstractAddressSetView- Returns:
- the first range in this set or null if the set is empty
-
getLastRange
Description copied from interface:AddressSetViewReturns the last range in this set or null if the set is empty- Specified by:
getLastRangein interfaceAddressSetView- Overrides:
getLastRangein classAbstractAddressSetView- Returns:
- the last range in this set or null if the set is empty
-
getRangeContaining
Returns the range that contains the given addressNote that adjacent or overlapping ranges may be omitted if they don't also contain the address.
- Specified by:
getRangeContainingin interfaceAddressSetView- Overrides:
getRangeContainingin classAbstractAddressSetView- Parameters:
address- the address for which to find a range.- Returns:
- the range that contains the given address.
-
findFirstAddressInCommon
Description copied from interface:AddressSetViewFinds the first address in this collection that is also in the given addressSet.- Specified by:
findFirstAddressInCommonin interfaceAddressSetView- Overrides:
findFirstAddressInCommonin classAbstractAddressSetView- Parameters:
set- the addressSet to search for the first (lowest) common address.- Returns:
- the first address that is contained in this set and the given set.
-