Class IndexMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
pascal.taie.util.collection.IndexMap<K,V>
Type Parameters:
K - the type of keys maintained by this map
V - the type of mapped values
All Implemented Interfaces:
Serializable, Map<K,V>

public class IndexMap<K,V> extends AbstractMap<K,V> implements Serializable
Array-based implementation of the Map interface.

This implementation requires a Indexer, which provides a unique index for each key object that could be put into this map. Since the indexer maintains the mappings between objects and indexes, this map does not need to store the keys, and it only keeps an array (values) of the corresponding values. A key object would be indexed to index by the indexer. If values[index] is null, it means that the corresponding key is absent in this map. Hence, it does not permit null values.

This implementation is designed for maps whose size is close to the universe.

See Also: