StringMap

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

StringMap allows mapping of String keys to arbitrary values.

See Map for documentation details.

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

Instance Members

set(key: String, value: haxe.ds.StringMap.T): Void

See Map.set

Name Type
key String
value haxe.ds.StringMap.T

get(key: String): Null<haxe.ds.StringMap.T>

See Map.get

Name Type
key String
Returns
Null<haxe.ds.StringMap.T>

exists(key: String): Bool

See Map.exists

Name Type
key String
Returns
Bool

remove(key: String): Bool

See Map.remove

Name Type
key String
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

clear(): Void

See Map.clear


new(): Void

Creates a new StringMap.

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.StringMap.T>

nBuckets: Int

size: Int

nOccupied: Int

upperBound: Int

cachedKey: String

cachedIndex: Int

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

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

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

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

Name Type
s String
Returns
haxe.ds._StringMap.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: String): Int
Name Type
key String
Returns
Int

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

Metadata

Name Parameters
:hxGen -