public class ImmutableLongMap<A>
extends java.lang.Object
Long
keys to avoid allocations (boxing).
Keys and values are backed by arrays and lookup is performed with binary
search. It's intended for rather small (<1000) maps.Modifier and Type | Method and Description |
---|---|
boolean |
contains(long key)
Worst case
O(log n) , allocation free. |
static <A> ImmutableLongMap<A> |
empty(scala.reflect.ClassTag<A> t) |
boolean |
equals(java.lang.Object obj) |
OptionVal<A> |
get(long key)
Worst case
O(log n) , allocation free. |
int |
hashCode() |
scala.collection.Iterator<java.lang.Object> |
keysIterator()
All keys
|
ImmutableLongMap<A> |
remove(long key) |
int |
size() |
java.lang.String |
toString() |
ImmutableLongMap<A> |
updated(long key,
A value)
Worst case
O(log n) , creates new ImmutableLongMap
with copies of the internal arrays for the keys and
values. |
public static <A> ImmutableLongMap<A> empty(scala.reflect.ClassTag<A> t)
public int size()
public OptionVal<A> get(long key)
O(log n)
, allocation free.key
- (undocumented)public boolean contains(long key)
O(log n)
, allocation free.key
- (undocumented)public ImmutableLongMap<A> updated(long key, A value)
O(log n)
, creates new ImmutableLongMap
with copies of the internal arrays for the keys and
values.key
- (undocumented)value
- (undocumented)public ImmutableLongMap<A> remove(long key)
public scala.collection.Iterator<java.lang.Object> keysIterator()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object