Class ImmutableLongMap<A>


  • public class ImmutableLongMap<A>
    extends java.lang.Object
    INTERNAL API Specialized Map for primitive 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.
    • Constructor Detail

      • ImmutableLongMap

        public ImmutableLongMap()
    • Method Detail

      • empty

        public static <A> ImmutableLongMap<A> empty​(scala.reflect.ClassTag<A> t)
      • size

        public int size()
      • get

        public OptionVal<A> get​(long key)
        Worst case O(log n), allocation free.
      • contains

        public boolean contains​(long key)
        Worst case O(log n), allocation free.
      • updated

        public 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.
      • keysIterator

        public scala.collection.Iterator<java.lang.Object> keysIterator()
        All keys
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object