Esempio n. 1
0
 public LongHashMapEntry(int par1, long par2, Object par4Obj, LongHashMapEntry par5LongHashMapEntry)
 {
     value = par4Obj;
     nextEntry = par5LongHashMapEntry;
     key = par2;
     hash = par1;
 }
Esempio n. 2
0
 public LongHashMapEntry(int par1, long par2, Object par4Obj, LongHashMapEntry par5LongHashMapEntry)
 {
     value     = par4Obj;
     nextEntry = par5LongHashMapEntry;
     key       = par2;
     hash      = par1;
 }
Esempio n. 3
0
        /**
         * removes the key from the hash linked list
         */
        LongHashMapEntry removeKey(long par1)
        {
            int i = getHashedKey(par1);
            int j = getHashIndex(i, hashArray.Length);
            LongHashMapEntry longhashmapentry = hashArray[j];
            LongHashMapEntry longhashmapentry1;
            LongHashMapEntry longhashmapentry2;

            for (longhashmapentry1 = longhashmapentry; longhashmapentry1 != null; longhashmapentry1 = longhashmapentry2)
            {
                longhashmapentry2 = longhashmapentry1.nextEntry;

                if (longhashmapentry1.key == par1)
                {
                    modCount++;
                    numHashElements--;

                    if (longhashmapentry == longhashmapentry1)
                    {
                        hashArray[j] = longhashmapentry2;
                    }
                    else
                    {
                        longhashmapentry.nextEntry = longhashmapentry2;
                    }

                    return(longhashmapentry1);
                }

                longhashmapentry = longhashmapentry1;
            }

            return(longhashmapentry1);
        }
Esempio n. 4
0
        /**
         * copies the hash table to the specified array
         */
        private void copyHashTableTo(LongHashMapEntry[] par1ArrayOfLongHashMapEntry)
        {
            LongHashMapEntry[] alonghashmapentry = hashArray;
            int i = par1ArrayOfLongHashMapEntry.Length;

            for (int j = 0; j < alonghashmapentry.Length; j++)
            {
                LongHashMapEntry longhashmapentry = alonghashmapentry[j];

                if (longhashmapentry == null)
                {
                    continue;
                }

                alonghashmapentry[j] = null;

                do
                {
                    LongHashMapEntry longhashmapentry1 = longhashmapentry.nextEntry;
                    int k = getHashIndex(longhashmapentry.hash, i);
                    longhashmapentry.nextEntry     = par1ArrayOfLongHashMapEntry[k];
                    par1ArrayOfLongHashMapEntry[k] = longhashmapentry;
                    longhashmapentry = longhashmapentry1;
                }while (longhashmapentry != null);
            }
        }
Esempio n. 5
0
        /**
         * creates the key in the hash table
         */
        private void createKey(int par1, long par2, Object par4Obj, int par5)
        {
            LongHashMapEntry longhashmapentry = hashArray[par5];

            hashArray[par5] = new LongHashMapEntry(par1, par2, par4Obj, longhashmapentry);

            if (numHashElements++ >= capacity)
            {
                resizeTable(2 * hashArray.Length);
            }
        }
Esempio n. 6
0
        LongHashMapEntry getEntry(long par1)
        {
            int i = getHashedKey(par1);

            for (LongHashMapEntry longhashmapentry = hashArray[getHashIndex(i, hashArray.Length)]; longhashmapentry != null; longhashmapentry = longhashmapentry.nextEntry)
            {
                if (longhashmapentry.key == par1)
                {
                    return(longhashmapentry);
                }
            }

            return(null);
        }
Esempio n. 7
0
        /**
         * add the key value pair to the list
         */
        public void add(long par1, Object par3Obj)
        {
            int i = getHashedKey(par1);
            int j = getHashIndex(i, hashArray.Length);

            for (LongHashMapEntry longhashmapentry = hashArray[j]; longhashmapentry != null; longhashmapentry = longhashmapentry.nextEntry)
            {
                if (longhashmapentry.key == par1)
                {
                    longhashmapentry.value = par3Obj;
                }
            }

            modCount++;
            createKey(i, par1, par3Obj, j);
        }
Esempio n. 8
0
        /**
         * resizes the table
         */
        private void resizeTable(int par1)
        {
            LongHashMapEntry[] alonghashmapentry = hashArray;
            int i = alonghashmapentry.Length;

            if (i == 0x40000000)
            {
                capacity = 0x7fffffff;
                return;
            }
            else
            {
                LongHashMapEntry[] alonghashmapentry1 = new LongHashMapEntry[par1];
                copyHashTableTo(alonghashmapentry1);
                hashArray = alonghashmapentry1;
                capacity  = (int)((float)par1 * percentUseable);
                return;
            }
        }
Esempio n. 9
0
        public bool equals(Object par1Obj)
        {
            if (!(par1Obj is LongHashMapEntry))
            {
                return(false);
            }

            LongHashMapEntry longhashmapentry = (LongHashMapEntry)par1Obj;
            Int64?           long1            = getKey();
            Int64?           long2            = longhashmapentry.getKey();

            if (long1 == long2 || long1 != null && long1.Equals(long2))
            {
                Object obj  = getValue();
                Object obj1 = longhashmapentry.getValue();

                if (obj == obj1 || obj != null && obj.Equals(obj1))
                {
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 10
0
        /**
         * resizes the table
         */
        private void resizeTable(int par1)
        {
            LongHashMapEntry[] alonghashmapentry = hashArray;
            int i = alonghashmapentry.Length;

            if (i == 0x40000000)
            {
                capacity = 0x7fffffff;
                return;
            }
            else
            {
                LongHashMapEntry[] alonghashmapentry1 = new LongHashMapEntry[par1];
                copyHashTableTo(alonghashmapentry1);
                hashArray = alonghashmapentry1;
                capacity = (int)((float)par1 * percentUseable);
                return;
            }
        }
Esempio n. 11
0
        /**
         * creates the key in the hash table
         */
        private void createKey(int par1, long par2, Object par4Obj, int par5)
        {
            LongHashMapEntry longhashmapentry = hashArray[par5];
            hashArray[par5] = new LongHashMapEntry(par1, par2, par4Obj, longhashmapentry);

            if (numHashElements++ >= capacity)
            {
                resizeTable(2 * hashArray.Length);
            }
        }
Esempio n. 12
0
        /**
         * copies the hash table to the specified array
         */
        private void copyHashTableTo(LongHashMapEntry[] par1ArrayOfLongHashMapEntry)
        {
            LongHashMapEntry[] alonghashmapentry = hashArray;
            int i = par1ArrayOfLongHashMapEntry.Length;

            for (int j = 0; j < alonghashmapentry.Length; j++)
            {
                LongHashMapEntry longhashmapentry = alonghashmapentry[j];

                if (longhashmapentry == null)
                {
                    continue;
                }

                alonghashmapentry[j] = null;

                do
                {
                    LongHashMapEntry longhashmapentry1 = longhashmapentry.nextEntry;
                    int k = getHashIndex(longhashmapentry.hash, i);
                    longhashmapentry.nextEntry = par1ArrayOfLongHashMapEntry[k];
                    par1ArrayOfLongHashMapEntry[k] = longhashmapentry;
                    longhashmapentry = longhashmapentry1;
                }
                while (longhashmapentry != null);
            }
        }
Esempio n. 13
0
        /**
         * calls the removeKey method and returns removed object
         */
        public Object remove(long par1)
        {
            LongHashMapEntry longhashmapentry = removeKey(par1);

            return(longhashmapentry != null ? longhashmapentry.value : null);
        }