shadow:standard

Class AddressMap

Parent class

shadow:standard@Object

Interfaces

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.

See Also

Create Summary

Modifiers Return Types Method and Description
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.

public () create(long initialCapacity, float loadFactor)

Creates an empty AddressMap with the specified capacity and maximum load factor.

Destroy Summary

Modifiers Return Types Method and Description
public () destroy()

Method Summary

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.

Property Summary

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.

Create Detail

create

public create() => ()

Creates an empty AddressMap with a default capacity of 16 and maximum load factor of 0.75.

create

public create(long initialCapacity) => ()

Creates an empty AddressMap with the specified capacity and maximum load factor of 0.75.

Parameters

initialCapacity - initial capacity of the map

create

public create(long initialCapacity, float loadFactor) => ()

Creates an empty AddressMap with the specified capacity and maximum load factor.

Parameters

initialCapacity - initial capacity of the map

loadFactor - maximum load factor before the map is resized

Destroy Detail

destroy

public destroy() => ()

Method Detail

clear

public locked clear() => (AddressMap)

Removes all entries from the map and resets the capacity to default.

Returns

map after being cleared

containsKey

public readonly locked containsKey(ulong key) => (boolean)

Checks to see if the map contains a key.

Parameters

key - key to find

Returns

true if present

containsValue

public readonly locked containsValue(ulong value) => (boolean)

Checks to see if the map contains a particular value.

Parameters

value - value to find

Returns

true if present

copy

public readonly copy(AddressMap addresses) => (AddressMap)

index

public readonly locked index(ulong key) => (nullable ulong)

Retrieves the address associated with the key. If the key is not present, null is returned.

Parameters

key - key to find

Returns

address at key location or null if not found

index

public locked index(ulong key, ulong value) => ()

Stores value address in the key address entry.

Parameters

key - key corresponding to old address

value - value corresponding to new address

isEmpty

public readonly locked isEmpty() => (boolean)

Checks whether or not the address map is empty.

Returns

true if the address map is empty

iterator

public readonly locked iterator() => (Iterator<ulong>)

Creates an iterator to iterate over all the values in the map.

Returns

iterator

remove

public locked remove(ulong key) => (nullable ulong)

Removes the value stored in the key value entry.

Parameters

key - key corresponding to old address

Returns

value being removed or null if not present

Property Detail

size

public readonly get locked size() => (int)

sizeLong

public readonly get locked sizeLong() => (long)

Gets current number of entries stored in the map.