Class TLongIntHashMap

    • Field Detail

      • _values

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

      • TLongIntHashMap

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

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

        public TLongIntHashMap(int initialCapacity,
                               float loadFactor)
        Creates a new TLongIntHashMap 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
      • TLongIntHashMap

        public TLongIntHashMap(int initialCapacity,
                               float loadFactor,
                               long noEntryKey,
                               int noEntryValue)
        Creates a new TLongIntHashMap 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 long value that represents null for the Key set.
        noEntryValue - a int value that represents null for the Value set.
      • TLongIntHashMap

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

        public TLongIntHashMap(TLongIntMap map)
        Creates a new TLongIntHashMap instance containing all of the entries in the map passed in.
        Parameters:
        map - a TLongIntMap 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  TLongIntHash
        Parameters:
        initialCapacity - an int value
        Returns:
        the actual capacity chosen
      • rehash

        protected void rehash(int newCapacity)
      • put

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

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

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

        public int get(long key)
      • clear

        public void clear()
      • isEmpty

        public boolean isEmpty()
      • remove

        public int remove(long key)
      • removeAt

        protected void removeAt(int index)
      • keys

        public long[] keys()
      • keys

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

        public int[] values()
      • values

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

        public boolean containsValue(int val)
      • containsKey

        public boolean containsKey(long key)
      • forEachValue

        public boolean forEachValue(TIntProcedure procedure)
      • transformValues

        public void transformValues(TIntFunction function)
      • increment

        public boolean increment(long key)
      • adjustValue

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

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

        public boolean equals(Object other)
      • hashCode

        public int hashCode()
      • toString

        public String toString()