HashMap

Data Structures View source
HashMap
public class HashMap<K,V> extends Table

Generic Table Wrapper. Keys and values are stored as ints. Handle keys are keyed by their handle id, so remove the entry before destroying the handle: ids are reused and a stale entry would be found under an unrelated new handle. Real keys and values are quantised to 3 decimals (R2I_PRECISION), so 0.0004 is stored as 0.

Inherits from: Table · See this type for inherited members.

Methods

has(K key) returns boolean

Whether a value exists under the given key or not

put(K key, V value)

Saves the given value under the given key

get(K key) returns V

Retrieves the value saved under the given key

remove(K key)

Removes the value saved under the given key

getAndRemove(K key) returns V

Retrieves the value saved under the given key and removes it

size() returns int
override function flush()