ObjectMap

haxe.ds.ObjectMap (Class)
Implements: haxe.IMap

ObjectMap allows mapping of object keys to arbitrary values.

On static targets, the keys are considered to be strong references. Refer to haxe.ds.WeakMap for a weak reference version.

See Map for documentation details.

See: https://haxe.org/manual/std-Map.html

Instance Members

set(key: haxe.ds.ObjectMap.K, value: haxe.ds.ObjectMap.V): Void

See Map.set

Name Type
key haxe.ds.ObjectMap.K
value haxe.ds.ObjectMap.V

get(key: haxe.ds.ObjectMap.K): Null<haxe.ds.ObjectMap.V>

See Map.get

Name Type
key haxe.ds.ObjectMap.K
Returns
Null<haxe.ds.ObjectMap.V>

remove(key: haxe.ds.ObjectMap.K): Bool

See Map.remove

Name Type
key haxe.ds.ObjectMap.K
Returns
Bool

keys(): Iterator

See Map.keys

(cs, java) Implementation detail: Do not set() any new value while iterating, as it may cause a resize, which will break iteration.

Returns
Iterator

iterator(): Iterator

See Map.iterator

(cs, java) Implementation detail: Do not set() any new value while iterating, as it may cause a resize, which will break iteration.

Returns
Iterator

keyValueIterator(): KeyValueIterator

See Map.keyValueIterator

Returns
KeyValueIterator

new(): Void

Creates a new ObjectMap.

Private Members

HASH_UPPER: Float

FLAG_EMPTY: Int

FLAG_DEL: Int

This is the most important structure here and the reason why it's so fast. It's an array of all the hashes contained in the table. These hashes cannot be 0 nor 1, which stand for "empty" and "deleted" states.

The lookup algorithm will keep looking until a 0 or the key wanted is found; The insertion algorithm will do the same but will also break when FLAG_DEL is found;


vals: cs.NativeArray<haxe.ds.ObjectMap.V>

nBuckets: Int

size: Int

nOccupied: Int

upperBound: Int

cachedKey: haxe.ds.ObjectMap.K

cachedIndex: Int

roundUp(x: Int): Int
Name Type
x Int
Returns
Int

getInc(k: Int, mask: Int): Int
Name Type
k Int
mask Int
Returns
Int

Name Type
v haxe.ds._ObjectMap.HashType
Returns
Bool

Name Type
v haxe.ds._ObjectMap.HashType
Returns
Bool

Name Type
v haxe.ds._ObjectMap.HashType
Returns
Bool

Name Type
s hash.K
Returns
haxe.ds._ObjectMap.HashType

arrayCopy(sourceArray: cs.system.Array, sourceIndex: Int, destinationArray: cs.system.Array, destinationIndex: Int, length: Int): Void
Name Type
sourceArray cs.system.Array
sourceIndex Int
destinationArray cs.system.Array
destinationIndex Int
length Int

assert(x: Bool): Void
Name Type
x Bool

lookup(key: haxe.ds.ObjectMap.K): Int
Name Type
key haxe.ds.ObjectMap.K
Returns
Int

resize(newNBuckets: Int): Void
Name Type
newNBuckets Int

Metadata

Name Parameters
:hxGen -