shadow:utility@Map<ulong,ulong>
locked class AddressMap
Class AddressMap
maps old object addresses to new object addresses. It is used when making a deep copy of an object so that an object that has already been copied won't be copied a second time. AddressMap
is essentially a reimplementation of HashMap<K,V>
, which cannot be used because generic types create problems for the compiler if used for these fundamental tasks.
Modifiers | Return Types | Method and Description |
---|---|---|
public |
() |
create() Creates an empty |
public |
() |
create(long initialCapacity) Creates an empty |
public |
() |
create(long initialCapacity, float loadFactor) Creates an empty |
Modifiers | Return Types | Method and Description |
---|---|---|
public |
() |
destroy() |
Modifiers | Return Types | Method and Description |
---|---|---|
public locked |
(AddressMap) |
clear() Removes all entries from the map and resets the capacity to default. |
public readonly locked |
(boolean) |
containsKey(ulong key) Checks to see if the map contains a key. |
public readonly locked |
(boolean) |
containsValue(ulong value) Checks to see if the map contains a particular value. |
public readonly |
(AddressMap) |
copy(AddressMap addresses) |
public readonly locked |
(nullable ulong) |
index(ulong key) Retrieves the address associated with the key. |
public locked |
() |
index(ulong key, ulong value) Stores value address in the key address entry. |
public readonly locked |
(boolean) |
isEmpty() Checks whether or not the address map is empty. |
public readonly locked |
(Iterator<ulong>) |
iterator() Creates an iterator to iterate over all the values in the map. |
public locked |
(nullable ulong) |
remove(ulong key) Removes the value stored in the key value entry. |
Modifiers | Return Types | Method and Description |
---|---|---|
public readonly get locked |
(int) |
size() |
public readonly get locked |
(long) |
sizeLong() Gets current number of entries stored in the map. |
public create() => ()
Creates an empty AddressMap
with a default capacity of 16 and maximum load factor of 0.75.
public create(long initialCapacity) => ()
Creates an empty AddressMap
with the specified capacity and maximum load factor of 0.75.
initialCapacity
- initial capacity of the map
public destroy() => ()
public locked clear() => (AddressMap)
Removes all entries from the map and resets the capacity to default.
map after being cleared
public readonly locked containsKey(ulong key) => (boolean)
Checks to see if the map contains a key.
key
- key to find
true
if present
public readonly locked containsValue(ulong value) => (boolean)
Checks to see if the map contains a particular value.
value
- value to find
true
if present
public readonly copy(AddressMap addresses) => (AddressMap)
public readonly locked index(ulong key) => (nullable ulong)
Retrieves the address associated with the key. If the key is not present, null
is returned.
key
- key to find
address at key location or null
if not found
public locked index(ulong key, ulong value) => ()
Stores value address in the key address entry.
key
- key corresponding to old address
value
- value corresponding to new address
public readonly locked isEmpty() => (boolean)
Checks whether or not the address map is empty.
true
if the address map is empty