Beispiel #1
0
        LongHashMapEntry removeKey(long l)
        {
            int i = getHashedKey(l);
            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 == l)
                {
                    modCount++;
                    numHashElements--;
                    if (longhashmapentry == longhashmapentry1)
                    {
                        hashArray[j] = longhashmapentry2;
                    }
                    else
                    {
                        longhashmapentry.nextEntry = longhashmapentry2;
                    }
                    return(longhashmapentry1);
                }
                longhashmapentry = longhashmapentry1;
            }

            return(longhashmapentry1);
        }
 public LongHashMapEntry(int i, long l, Object obj, LongHashMapEntry longhashmapentry)
 {
     value        = obj;
     nextEntry    = longhashmapentry;
     key          = l;
     field_1026_d = i;
 }
 public LongHashMapEntry(int i, long l, Object obj, LongHashMapEntry longhashmapentry)
 {
     value = obj;
     nextEntry = longhashmapentry;
     key = l;
     field_1026_d = i;
 }
 public LongHashMapEntry(int i, long l, Object obj, LongHashMapEntry playerhashentry)
 {
     value = obj;
     nextEntry = playerhashentry;
     key = l;
     field_1026_d = i;
 }
Beispiel #5
0
        private void createKey(int i, long l, Object obj, int j)
        {
            LongHashMapEntry longhashmapentry = hashArray[j];

            hashArray[j] = new LongHashMapEntry(i, l, obj, longhashmapentry);
            if (numHashElements++ >= capacity)
            {
                resizeTable(2 * hashArray.Length);
            }
        }
Beispiel #6
0
        LongHashMapEntry func_35507_c(long l)
        {
            int i = getHashedKey(l);

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

            return(null);
        }
Beispiel #7
0
        public Object getValueByKey(long l)
        {
            int i = getHashedKey(l);

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

            return(null);
        }
Beispiel #8
0
        public void add(long l, Object obj)
        {
            int i = getHashedKey(l);
            int j = getHashIndex(i, hashArray.Length);

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

            modCount++;
            createKey(i, l, obj, j);
        }
Beispiel #9
0
        private void resizeTable(int i)
        {
            LongHashMapEntry[] alonghashmapentry = hashArray;
            int j = alonghashmapentry.Length;

            if (j == 0x40000000)
            {
                capacity = 0x7fffffff;
                return;
            }
            else
            {
                LongHashMapEntry[] aplayerhashentry1 = new LongHashMapEntry[i];
                copyHashTableTo(aplayerhashentry1);
                hashArray = aplayerhashentry1;
                capacity  = (int)((float)i * percentUsable);
                return;
            }
        }
        public override bool Equals(object obj)
        {
            if (!(obj is LongHashMapEntry))
            {
                return(false);
            }
            LongHashMapEntry longhashmapentry = (LongHashMapEntry)obj;
            long             long1            = func_736_a();
            long             long2            = longhashmapentry.func_736_a();

            if (long1 == long2 || long1 != null && long1.Equals(long2))
            {
                object obj1 = func_735_b();
                object obj2 = longhashmapentry.func_735_b();
                if (obj1 == obj2 || obj1 != null && obj1.Equals(obj2))
                {
                    return(true);
                }
            }
            return(false);
        }
Beispiel #11
0
        private void copyHashTableTo(LongHashMapEntry[] alonghashmapentry)
        {
            LongHashMapEntry[] alonghashmapentry1 = hashArray;
            int i = alonghashmapentry.Length;

            for (int j = 0; j < alonghashmapentry1.Length; j++)
            {
                LongHashMapEntry longhashmapentry = alonghashmapentry1[j];
                if (longhashmapentry == null)
                {
                    continue;
                }
                alonghashmapentry1[j] = null;
                do
                {
                    LongHashMapEntry playerhashentry1 = longhashmapentry.nextEntry;
                    int k = getHashIndex(longhashmapentry.field_1026_d, i);
                    longhashmapentry.nextEntry = alonghashmapentry[k];
                    alonghashmapentry[k]       = longhashmapentry;
                    longhashmapentry           = playerhashentry1;
                } while(longhashmapentry != null);
            }
        }
Beispiel #12
0
 public LongHashMap()
 {
     capacity  = 12;
     hashArray = new LongHashMapEntry[16];
 }
Beispiel #13
0
        public Object remove(long l)
        {
            LongHashMapEntry longhashmapentry = removeKey(l);

            return(longhashmapentry != null ? longhashmapentry.value : null);
        }
Beispiel #14
0
 private void copyHashTableTo(LongHashMapEntry[] alonghashmapentry)
 {
     LongHashMapEntry[] alonghashmapentry1 = hashArray;
     int i = alonghashmapentry.Length;
     for(int j = 0; j < alonghashmapentry1.Length; j++)
     {
         LongHashMapEntry longhashmapentry = alonghashmapentry1[j];
         if(longhashmapentry == null)
         {
             continue;
         }
         alonghashmapentry1[j] = null;
         do
         {
             LongHashMapEntry playerhashentry1 = longhashmapentry.nextEntry;
             int k = getHashIndex(longhashmapentry.field_1026_d, i);
             longhashmapentry.nextEntry = alonghashmapentry[k];
             alonghashmapentry[k] = longhashmapentry;
             longhashmapentry = playerhashentry1;
         } while(longhashmapentry != null);
     }
 }
Beispiel #15
0
 private void resizeTable(int i)
 {
     LongHashMapEntry[] alonghashmapentry = hashArray;
     int j = alonghashmapentry.Length;
     if(j == 0x40000000)
     {
         capacity = 0x7fffffff;
         return;
     } else
     {
         LongHashMapEntry[] aplayerhashentry1 = new LongHashMapEntry[i];
         copyHashTableTo(aplayerhashentry1);
         hashArray = aplayerhashentry1;
         capacity = (int)((float)i * percentUsable);
         return;
     }
 }
Beispiel #16
0
 private void createKey(int i, long l, Object obj, int j)
 {
     LongHashMapEntry longhashmapentry = hashArray[j];
     hashArray[j] = new LongHashMapEntry(i, l, obj, longhashmapentry);
     if(numHashElements++ >= capacity)
     {
         resizeTable(2 * hashArray.Length);
     }
 }