Class TIntLongHashMap

    • Field Detail

      • _values

        protected transient long[] _values
        the values of the map
    • Constructor Detail

      • TIntLongHashMap

        public TIntLongHashMap()
        Creates a new TIntLongHashMap instance with the default capacity and load factor.
      • TIntLongHashMap

        public TIntLongHashMap(int initialCapacity)
        Creates a new TIntLongHashMap instance with a prime capacity equal to or greater than initialCapacity and with the default load factor.
        Parameters:
        initialCapacity - an int value
      • TIntLongHashMap

        public TIntLongHashMap(int initialCapacity,
                               float loadFactor)
        Creates a new TIntLongHashMap instance with a prime capacity equal to or greater than initialCapacity and with the specified load factor.
        Parameters:
        initialCapacity - an int value
        loadFactor - a float value
      • TIntLongHashMap

        public TIntLongHashMap(int initialCapacity,
                               float loadFactor,
                               int noEntryKey,
                               long noEntryValue)
        Creates a new TIntLongHashMap instance with a prime capacity equal to or greater than initialCapacity and with the specified load factor.
        Parameters:
        initialCapacity - an int value
        loadFactor - a float value
        noEntryKey - a int value that represents null for the Key set.
        noEntryValue - a long value that represents null for the Value set.
      • TIntLongHashMap

        public TIntLongHashMap(int[] keys,
                               long[] values)
        Creates a new TIntLongHashMap instance containing all of the entries in the map passed in.
        Parameters:
        keys - a int array containing the keys for the matching values.
        values - a long array containing the values.
      • TIntLongHashMap

        public TIntLongHashMap(TIntLongMap map)
        Creates a new TIntLongHashMap instance containing all of the entries in the map passed in.
        Parameters:
        map - a TIntLongMap that will be duplicated.
    • Method Detail

      • setUp

        protected int setUp(int initialCapacity)
        initializes the hashtable to a prime capacity which is at least initialCapacity + 1.
        Overrides:
        setUp in class  TIntLongHash
        Parameters:
        initialCapacity - an int value
        Returns:
        the actual capacity chosen
      • rehash

        protected void rehash(int newCapacity)
      • put

        public long put(int key,
                        long value)
      • putIfAbsent

        public long putIfAbsent(int key,
                                long value)
      • putAll

        public void putAll(Map<? extends Integer,? extends Long> map)
      • get

        public long get(int key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public long remove(int key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public int[] keys()
      • keys

        public int[] keys(int[] array)
      • values

        public long[] values()
      • values

        public long[] values(long[] array)
      • containsValue

        public boolean containsValue(long val)
      • containsKey

        public boolean containsKey(int key)
      • forEachKey

        public boolean forEachKey(TIntProcedure procedure)
      • forEachValue

        public boolean forEachValue(TLongProcedure procedure)
      • transformValues

        public void transformValues(TLongFunction function)
      • increment

        public boolean increment(int key)
      • adjustValue

        public boolean adjustValue(int key,
                                   long amount)
      • adjustOrPutValue

        public long adjustOrPutValue(int key,
                                     long adjust_amount,
                                     long put_amount)
      • equals

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()