Class AddressSegmentMap<T extends ISegment<Long>>

All Implemented Interfaces:
ISegmentMap<Long,T>, Serializable, Cloneable, ConcurrentMap<Long,T>, ConcurrentNavigableMap<Long,T>, Map<Long,T>, NavigableMap<Long,T>, SortedMap<Long,T>

@Ser public final class AddressSegmentMap<T extends ISegment<Long>> extends SegmentMap<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:
  • 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

      public final boolean isValidKey(Long k)
      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 of Map.

      This method is called when attempting to insert an entry into a map (using add, put, or putall).

      Overrides:
      isValidKey in class SegmentMap<Long,T extends ISegment<Long>>
      Parameters:
      k - a key
      Returns:
      true or false