Class ArrayMap<K extends Comparable<? super K>,​V>

java.lang.Object
de.scravy.bedrock.ArrayMap<K,​V>
Type Parameters:
K - The type of the keys of this ArrayMap. Must implement Comparable. Does not allow for null values.
V - The type of the values of this ArrayMap. Can be anything. Allows for null values.
All Implemented Interfaces:
ExtendedIterable<Pair<K,​V>>, Function1<K,​V>, HasLengthAtLeast, Mapping<K,​V>, Iterable<Pair<K,​V>>, Function<K,​V>

@Immutable
public final class ArrayMap<K extends Comparable<? super K>,​V>
extends Object
implements Mapping<K,​V>
A very simple immutable map that is backed by two arrays (one for the keys, one for the values). Lookups are performed by performing binary searches on the key array - thus the keys need to implement the Comparable interface.

Some operations are implemented quite space efficiently. For instance both mapValues and mapValuesWithKey share the key array with the source ArrayMap.