haXe API Documentation
Back |
Indexclass Hash<T>
Available in flash8, neko, js, flash, php, cpp, cs, java
Hashtable over a set of elements, using String
as keys.
Other kind of keys are not possible on all platforms since they
can't always be implemented efficiently.
- function new() : Void
- Creates a new empty hashtable.
- function exists(key : String) : Bool
- Tells if a value exists for the given key.
In particular, it's useful to tells if a key has
a
null
value versus no value. - function get(key : String) : Null<T>
- Get a value for the given key.
- function iterator() : Iterator<T>
Available in flash8, neko, js, flash, php, cpp
- Returns an iterator of all values in the hashtable.
- function iterator() : Iterator<T>
Available in cs, java
- Returns an iterator of all values in the hashtable.
Implementation detail: Do not set() any new value while iterating, as it may cause a resize, which will break iteration
- function keys() : Iterator<String>
Available in flash8, neko, js, flash, php, cpp
- Returns an iterator of all keys in the hashtable.
- function keys() : Iterator<String>
Available in cs, java
- Returns an iterator of all keys in the hashtable.
Implementation detail: Do not set() any new value while iterating, as it may cause a resize, which will break iteration
- function remove(key : String) : Bool
- Removes a hashtable entry. Returns
true
if
there was such entry. - function set(key : String, value : T) : Void
- Set a value for the given key.
- function toString() : String
- Returns an displayable representation of the hashtable content.
Back |
Index