Package com.pnfsoftware.jeb.util.collect
Class AddressSegmentMap<T extends ISegment<Long>>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentSkipListMap<K,V>
com.pnfsoftware.jeb.util.collect.SegmentMap<Long,T>
com.pnfsoftware.jeb.util.collect.AddressSegmentMap<T>
- All Implemented Interfaces:
ISegmentMap<Long,
,T> Serializable
,Cloneable
,ConcurrentMap<Long,
,T> ConcurrentNavigableMap<Long,
,T> Map<Long,
,T> NavigableMap<Long,
,T> SortedMap<Long,
T>
Segment-map specialized to handle memory addresses, up to 64-bit. The addresses are represented
as longs, and should be interpreted as unsigned.
Caveat: for 64-bit spaces, the theoretically addressable byte (address 0xFFFF_FFFF_FFFF_FFFF) is not accessible. Therefore, a segment such as (base=0xFFFF_FFFF_FFFF_FFF0,size=0x10) is attempting to insert it into the map will throw an exception. The following segment would be valid: (base=0xFFFF_FFFF_FFFF_FFF0,size=0xF)
Thread safety: partially concurrent (refer to SegmentMap
)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionAddressSegmentMap
(int bitsize) Create a segment-map designed to hold memory keys as addresses. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
isValidKey
(Long k) Validate whether or not the provided key is valid.Methods inherited from class com.pnfsoftware.jeb.util.collect.SegmentMap
add, addAndMerge, compareKeys, contiguousSubMap, equals, fillGaps, generateGapItems, generateGaps, generateGaps, getOverlappingSegmentsMap, getSegmentAfter, getSegmentBefore, getSegmentContaining, hashCode, isEmptyRange, isRemoveSegmentsOnOverlap, isValidSegment, put, putAll, setRemoveSegmentsOnOverlap, subMap, toString
Methods inherited from class java.util.concurrent.ConcurrentSkipListMap
ceilingEntry, ceilingKey, clear, clone, comparator, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, getOrDefault, headMap, headMap, higherEntry, higherKey, isEmpty, keySet, lastEntry, lastKey, lowerEntry, lowerKey, merge, navigableKeySet, pollFirstEntry, pollLastEntry, putIfAbsent, remove, remove, replace, replace, replaceAll, size, subMap, tailMap, tailMap, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, get, isEmpty, remove, size
Methods inherited from interface java.util.NavigableMap
ceilingEntry, ceilingKey, firstEntry, floorEntry, floorKey, higherEntry, higherKey, lastEntry, lowerEntry, lowerKey, pollFirstEntry, pollLastEntry
-
Constructor Details
-
AddressSegmentMap
public AddressSegmentMap(int bitsize) Create a segment-map designed to hold memory keys as addresses.- Parameters:
bitsize
- in [1, 64]
-
-
Method Details
-
isValidKey
Description copied from class:SegmentMap
Validate whether or not the provided key is valid. The default implementation simply returns true: all objects of type K are valid keys, as would be expected by an implementation ofMap
.This method is called when attempting to insert an entry into a map (using
add
,put
, orputall
).- Overrides:
isValidKey
in classSegmentMap<Long,
T extends ISegment<Long>> - Parameters:
k
- a key- Returns:
- true or false
-