예제 #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);
        }
예제 #2
0
 public LongHashMapEntry(int i, long l, Object obj, LongHashMapEntry longhashmapentry)
 {
     value        = obj;
     nextEntry    = longhashmapentry;
     key          = l;
     field_1026_d = i;
 }
예제 #3
0
 public LongHashMapEntry(int i, long l, Object obj, LongHashMapEntry longhashmapentry)
 {
     value = obj;
     nextEntry = longhashmapentry;
     key = l;
     field_1026_d = i;
 }
예제 #4
0
 public LongHashMapEntry(int i, long l, Object obj, LongHashMapEntry playerhashentry)
 {
     value = obj;
     nextEntry = playerhashentry;
     key = l;
     field_1026_d = i;
 }
예제 #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);
            }
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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;
            }
        }
예제 #10
0
        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);
        }
예제 #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);
            }
        }
예제 #12
0
 public LongHashMap()
 {
     capacity  = 12;
     hashArray = new LongHashMapEntry[16];
 }
예제 #13
0
        public Object remove(long l)
        {
            LongHashMapEntry longhashmapentry = removeKey(l);

            return(longhashmapentry != null ? longhashmapentry.value : null);
        }
예제 #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);
     }
 }
예제 #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;
     }
 }
예제 #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);
     }
 }