一、前言
关于j3d源码包中org.j3d.util.CharHashMap/IntHashMap/FloatHashMap/DoubleHashMap自定义字符串Map类,实现基于数组Entry[]数据存储方式,详情参见源码说明部分。
二、源码说明
package org.j3d.util;@b@@b@public class CharHashMap@b@{@b@ private transient Entry[] table;@b@ private transient int count;@b@ private int threshold;@b@ private float loadFactor;@b@@b@ public CharHashMap()@b@ {@b@ this(20, 0.75F);@b@ }@b@@b@ public CharHashMap(int paramInt)@b@ {@b@ this(paramInt, 0.75F);@b@ }@b@@b@ public CharHashMap(int paramInt, float paramFloat)@b@ {@b@ if (paramInt < 0)@b@ throw new IllegalArgumentException("Illegal Capacity: " + paramInt);@b@@b@ if (paramFloat <= 0.0F)@b@ throw new IllegalArgumentException("Illegal Load: " + paramFloat);@b@@b@ if (paramInt == 0)@b@ paramInt = 1;@b@@b@ this.loadFactor = paramFloat;@b@ this.table = new Entry[paramInt];@b@ this.threshold = (int)(paramInt * paramFloat);@b@ }@b@@b@ public int size()@b@ {@b@ return this.count;@b@ }@b@@b@ public boolean isEmpty()@b@ {@b@ return (this.count == 0);@b@ }@b@@b@ public boolean contains(Object paramObject)@b@ {@b@ if (paramObject == null)@b@ {@b@ throw new NullPointerException();@b@ }@b@@b@ Entry[] arrayOfEntry = this.table;@b@ int i = arrayOfEntry.length; if (i-- > 0)@b@ {@b@ Entry localEntry = arrayOfEntry[i];@b@ while (true) { if (localEntry == null);@b@ if (localEntry.value.equals(paramObject))@b@ {@b@ return true;@b@ }@b@ localEntry = localEntry.next;@b@ }@b@@b@ }@b@@b@ return false;@b@ }@b@@b@ public boolean containsValue(Object paramObject)@b@ {@b@ return contains(paramObject);@b@ }@b@@b@ public boolean containsKey(char paramChar)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ int i = paramChar;@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if (localEntry.hash == i)@b@ {@b@ return true;@b@ }@b@ }@b@ return false;@b@ }@b@@b@ public Object get(char paramChar)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ int i = paramChar;@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if (localEntry.hash == i)@b@ {@b@ return localEntry.value;@b@ }@b@ }@b@ return null;@b@ }@b@@b@ protected void rehash()@b@ {@b@ int i = this.table.length;@b@ Entry[] arrayOfEntry1 = this.table;@b@@b@ int j = i * 2 + 1;@b@ Entry[] arrayOfEntry2 = new Entry[j];@b@@b@ this.threshold = (int)(j * this.loadFactor);@b@ this.table = arrayOfEntry2;@b@@b@ int k = i; if (k-- > 0)@b@ {@b@ Entry localEntry1 = arrayOfEntry1[k];@b@ while (true) { if (localEntry1 == null);@b@ Entry localEntry2 = localEntry1;@b@ localEntry1 = localEntry1.next;@b@@b@ int l = (localEntry2.hash & 0x7FFFFFFF) % j;@b@ localEntry2.next = arrayOfEntry2[l];@b@ arrayOfEntry2[l] = localEntry2;@b@ }@b@ }@b@ }@b@@b@ public Object put(char paramChar, Object paramObject)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ int i = paramChar;@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if (localEntry.hash == i)@b@ {@b@ Object localObject = localEntry.value;@b@ localEntry.value = paramObject;@b@ return localObject;@b@ }@b@ }@b@@b@ if (this.count >= this.threshold)@b@ {@b@ rehash();@b@@b@ arrayOfEntry = this.table;@b@ j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ }@b@@b@ localEntry = new Entry(i, paramChar, paramObject, arrayOfEntry[j]);@b@ arrayOfEntry[j] = localEntry;@b@ this.count += 1;@b@ return null;@b@ }@b@@b@ public Object remove(char paramChar)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ int i = paramChar;@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ Entry localEntry1 = arrayOfEntry[j]; for (Entry localEntry2 = null; localEntry1 != null; )@b@ {@b@ if (localEntry1.hash == i)@b@ {@b@ if (localEntry2 != null)@b@ {@b@ localEntry2.next = localEntry1.next;@b@ }@b@ else@b@ arrayOfEntry[j] = localEntry1.next;@b@@b@ this.count -= 1;@b@ Object localObject = localEntry1.value;@b@ localEntry1.value = null;@b@ return localObject;@b@ }@b@ localEntry2 = localEntry1; localEntry1 = localEntry1.next;@b@ }@b@@b@ return null;@b@ }@b@@b@ public synchronized void clear()@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ for (int i = arrayOfEntry.length; --i >= 0; )@b@ arrayOfEntry[i] = null;@b@ this.count = 0;@b@ }@b@@b@ private static class Entry@b@ {@b@ int hash;@b@ char key;@b@ Object value;@b@ Entry next;@b@@b@ protected Entry(int paramInt, char paramChar, Object paramObject, Entry paramEntry)@b@ {@b@ this.hash = paramInt;@b@ this.key = paramChar;@b@ this.value = paramObject;@b@ this.next = paramEntry;@b@ }@b@ }@b@}
package org.j3d.util;@b@@b@import java.util.Arrays;@b@@b@public class DoubleHashMap@b@{@b@ private transient Entry[] table;@b@ private transient int count;@b@ private int threshold;@b@ private float loadFactor;@b@ private transient int modCount;@b@@b@ public DoubleHashMap()@b@ {@b@ this(20, 0.75F);@b@ }@b@@b@ public DoubleHashMap(int paramInt)@b@ {@b@ this(paramInt, 0.75F);@b@ }@b@@b@ public DoubleHashMap(int paramInt, float paramFloat)@b@ {@b@ this.count = 0;@b@@b@ this.modCount = 0;@b@@b@ if (paramInt < 0)@b@ throw new IllegalArgumentException("Illegal Capacity: " + paramInt);@b@@b@ if (paramFloat <= 0.0F)@b@ throw new IllegalArgumentException("Illegal Load: " + paramFloat);@b@@b@ if (paramInt == 0)@b@ paramInt = 1;@b@@b@ this.loadFactor = paramFloat;@b@ this.table = new Entry[paramInt];@b@ this.threshold = (int)(paramInt * paramFloat);@b@ }@b@@b@ public int size()@b@ {@b@ return this.count;@b@ }@b@@b@ public boolean isEmpty()@b@ {@b@ return (this.count == 0);@b@ }@b@@b@ public boolean contains(Object paramObject)@b@ {@b@ if (paramObject == null)@b@ {@b@ throw new NullPointerException("value object may not be null!");@b@ }@b@@b@ Entry[] arrayOfEntry = this.table;@b@ int i = arrayOfEntry.length; if (i-- > 0)@b@ {@b@ Entry localEntry = arrayOfEntry[i];@b@ while (true) { if (localEntry == null);@b@ if (localEntry.value.equals(paramObject))@b@ {@b@ return true;@b@ }@b@ localEntry = localEntry.next;@b@ }@b@@b@ }@b@@b@ return false;@b@ }@b@@b@ public boolean containsValue(Object paramObject)@b@ {@b@ return contains(paramObject);@b@ }@b@@b@ public boolean containsKey(double paramDouble)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ long l = Double.doubleToLongBits(paramDouble);@b@ int i = (int)(l ^ l >>> 32);@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if ((localEntry.hash == i) && (localEntry.key == paramDouble))@b@ {@b@ return true;@b@ }@b@ }@b@ return false;@b@ }@b@@b@ public Object get(double paramDouble)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ long l = Double.doubleToLongBits(paramDouble);@b@ int i = (int)(l ^ l >>> 32);@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if ((localEntry.hash == i) && (localEntry.key == paramDouble))@b@ {@b@ return localEntry.value;@b@ }@b@ }@b@ return null;@b@ }@b@@b@ public Object put(double paramDouble, Object paramObject)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ long l = Double.doubleToLongBits(paramDouble);@b@ int i = (int)(l ^ l >>> 32);@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if ((localEntry.hash == i) && (localEntry.key == paramDouble))@b@ {@b@ Object localObject = localEntry.value;@b@ localEntry.value = paramObject;@b@ return localObject;@b@ }@b@ }@b@@b@ this.modCount += 1;@b@ if (this.count >= this.threshold)@b@ {@b@ rehash();@b@@b@ arrayOfEntry = this.table;@b@ j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ }@b@@b@ localEntry = new Entry(i, paramDouble, paramObject, arrayOfEntry[j]);@b@ arrayOfEntry[j] = localEntry;@b@ this.count += 1;@b@ return null;@b@ }@b@@b@ public Object remove(double paramDouble)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ long l = Double.doubleToLongBits(paramDouble);@b@ int i = (int)(l ^ l >>> 32);@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ Entry localEntry1 = arrayOfEntry[j]; for (Entry localEntry2 = null; localEntry1 != null; )@b@ {@b@ if ((localEntry1.hash == i) && (localEntry1.key == paramDouble))@b@ {@b@ this.modCount += 1;@b@ if (localEntry2 != null)@b@ {@b@ localEntry2.next = localEntry1.next;@b@ }@b@ else@b@ arrayOfEntry[j] = localEntry1.next;@b@@b@ this.count -= 1;@b@ Object localObject = localEntry1.value;@b@ localEntry1.value = null;@b@ return localObject;@b@ }@b@ localEntry2 = localEntry1; localEntry1 = localEntry1.next;@b@ }@b@@b@ return null;@b@ }@b@@b@ public synchronized void clear()@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ this.modCount += 1;@b@ for (int i = arrayOfEntry.length; --i >= 0; )@b@ arrayOfEntry[i] = null;@b@ this.count = 0;@b@ }@b@@b@ public double[] keySet()@b@ {@b@ double[] arrayOfDouble = new double[this.count];@b@ int i = 0;@b@@b@ Entry[] arrayOfEntry = this.table;@b@ int j = arrayOfEntry.length; if (j-- > 0)@b@ {@b@ Entry localEntry = arrayOfEntry[j];@b@ while (true) { if (localEntry == null);@b@ arrayOfDouble[(i++)] = localEntry.key;@b@@b@ localEntry = localEntry.next;@b@ }@b@@b@ }@b@@b@ return arrayOfDouble;@b@ }@b@@b@ public double[] keysSorted()@b@ {@b@ double[] arrayOfDouble = keySet();@b@ Arrays.sort(arrayOfDouble);@b@@b@ return arrayOfDouble;@b@ }@b@@b@ private void rehash()@b@ {@b@ int i = this.table.length;@b@ Entry[] arrayOfEntry1 = this.table;@b@@b@ int j = i * 2 + 1;@b@ Entry[] arrayOfEntry2 = new Entry[j];@b@@b@ this.modCount += 1;@b@ this.threshold = (int)(j * this.loadFactor);@b@ this.table = arrayOfEntry2;@b@@b@ int k = i; if (k-- > 0)@b@ {@b@ Entry localEntry1 = arrayOfEntry1[k];@b@ while (true) { if (localEntry1 == null);@b@ Entry localEntry2 = localEntry1;@b@ localEntry1 = localEntry1.next;@b@@b@ int l = (localEntry2.hash & 0x7FFFFFFF) % j;@b@ localEntry2.next = arrayOfEntry2[l];@b@ arrayOfEntry2[l] = localEntry2;@b@ }@b@ }@b@ }@b@@b@ private static class Entry@b@ {@b@ int hash;@b@ double key;@b@ Object value;@b@ Entry next;@b@@b@ protected Entry(int paramInt, double paramDouble, Object paramObject, Entry paramEntry)@b@ {@b@ this.hash = paramInt;@b@ this.key = paramDouble;@b@ this.value = paramObject;@b@ this.next = paramEntry;@b@ }@b@ }@b@}
package org.j3d.util;@b@@b@import java.util.ArrayList;@b@import java.util.Arrays;@b@@b@public class IntHashMap@b@{@b@ private static final String NO_VALUE_ERR = "No value was provided to compare against";@b@ private transient Entry[] table;@b@ private transient int count;@b@ private int threshold;@b@ private float loadFactor;@b@ private ArrayList entryCache;@b@@b@ public IntHashMap()@b@ {@b@ this(20, 0.75F);@b@ }@b@@b@ public IntHashMap(int paramInt)@b@ {@b@ this(paramInt, 0.75F);@b@ }@b@@b@ public IntHashMap(int paramInt, float paramFloat)@b@ {@b@ if (paramInt < 0)@b@ throw new IllegalArgumentException("Illegal Capacity: " + paramInt);@b@@b@ if (paramFloat <= 0.0F)@b@ throw new IllegalArgumentException("Illegal Load: " + paramFloat);@b@@b@ if (paramInt == 0)@b@ paramInt = 1;@b@@b@ this.loadFactor = paramFloat;@b@ this.table = new Entry[paramInt];@b@ this.threshold = (int)(paramInt * paramFloat);@b@@b@ this.entryCache = new ArrayList(paramInt);@b@ }@b@@b@ public int size()@b@ {@b@ return this.count;@b@ }@b@@b@ public boolean isEmpty()@b@ {@b@ return (this.count == 0);@b@ }@b@@b@ public boolean contains(Object paramObject)@b@ {@b@ if (paramObject == null)@b@ throw new NullPointerException("No value was provided to compare against");@b@@b@ Entry[] arrayOfEntry = this.table;@b@ int i = arrayOfEntry.length; if (i-- > 0)@b@ {@b@ Entry localEntry = arrayOfEntry[i];@b@ while (true) { if (localEntry == null);@b@ if (localEntry.value.equals(paramObject))@b@ return true;@b@ localEntry = localEntry.next;@b@ }@b@@b@ }@b@@b@ return false;@b@ }@b@@b@ public boolean containsValue(Object paramObject)@b@ {@b@ return contains(paramObject);@b@ }@b@@b@ public boolean containsKey(int paramInt)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ int i = paramInt;@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if (localEntry.hash == i)@b@ return true;@b@ }@b@ return false;@b@ }@b@@b@ public Object get(int paramInt)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ int i = paramInt;@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if (localEntry.hash == i)@b@ return localEntry.value;@b@ }@b@ return null;@b@ }@b@@b@ public int[] keySet()@b@ {@b@ int[] arrayOfInt = new int[this.count];@b@ int i = 0;@b@@b@ Entry[] arrayOfEntry = this.table;@b@ int j = arrayOfEntry.length; if (j-- > 0)@b@ {@b@ Entry localEntry = arrayOfEntry[j];@b@ while (true) { if (localEntry == null);@b@ arrayOfInt[(i++)] = localEntry.key;@b@@b@ localEntry = localEntry.next;@b@ }@b@@b@ }@b@@b@ return arrayOfInt;@b@ }@b@@b@ public int[] keySet(int[] paramArrayOfInt)@b@ {@b@ int[] arrayOfInt;@b@ if ((paramArrayOfInt == null) || (paramArrayOfInt.length < this.count))@b@ arrayOfInt = new int[this.count];@b@ else@b@ arrayOfInt = paramArrayOfInt;@b@@b@ int i = 0;@b@@b@ Entry[] arrayOfEntry = this.table;@b@ int j = arrayOfEntry.length; if (j-- > 0)@b@ {@b@ Entry localEntry = arrayOfEntry[j];@b@ while (true) { if (localEntry == null);@b@ arrayOfInt[(i++)] = localEntry.key;@b@@b@ localEntry = localEntry.next;@b@ }@b@@b@ }@b@@b@ return arrayOfInt;@b@ }@b@@b@ public int[] keySetSorted()@b@ {@b@ int[] arrayOfInt = keySet();@b@ Arrays.sort(arrayOfInt);@b@@b@ return arrayOfInt;@b@ }@b@@b@ public int[] keySetSorted(int[] paramArrayOfInt)@b@ {@b@ int[] arrayOfInt = keySet(paramArrayOfInt);@b@ Arrays.sort(arrayOfInt);@b@@b@ return arrayOfInt;@b@ }@b@@b@ protected void rehash()@b@ {@b@ int i = this.table.length;@b@ Entry[] arrayOfEntry1 = this.table;@b@@b@ int j = i * 2 + 1;@b@ Entry[] arrayOfEntry2 = new Entry[j];@b@@b@ this.threshold = (int)(j * this.loadFactor);@b@ this.table = arrayOfEntry2;@b@@b@ int k = i; if (k-- > 0)@b@ {@b@ Entry localEntry1 = arrayOfEntry1[k];@b@ while (true) { if (localEntry1 == null);@b@ Entry localEntry2 = localEntry1;@b@ localEntry1 = localEntry1.next;@b@@b@ int l = (localEntry2.hash & 0x7FFFFFFF) % j;@b@ localEntry2.next = arrayOfEntry2[l];@b@ arrayOfEntry2[l] = localEntry2;@b@ }@b@ }@b@ }@b@@b@ public Object put(int paramInt, Object paramObject)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ int i = paramInt;@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if (localEntry.hash == i)@b@ {@b@ Object localObject = localEntry.value;@b@ localEntry.value = paramObject;@b@ return localObject;@b@ }@b@ }@b@@b@ if (this.count >= this.threshold)@b@ {@b@ rehash();@b@@b@ arrayOfEntry = this.table;@b@ j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ }@b@@b@ localEntry = getNewEntry();@b@ localEntry.set(i, paramInt, paramObject, arrayOfEntry[j]);@b@@b@ arrayOfEntry[j] = localEntry;@b@ this.count += 1;@b@ return null;@b@ }@b@@b@ public Object remove(int paramInt)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ int i = paramInt;@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ Entry localEntry1 = arrayOfEntry[j]; for (Entry localEntry2 = null; localEntry1 != null; )@b@ {@b@ if (localEntry1.hash == i)@b@ {@b@ if (localEntry2 != null)@b@ {@b@ localEntry2.next = localEntry1.next;@b@ }@b@ else@b@ {@b@ arrayOfEntry[j] = localEntry1.next;@b@ }@b@@b@ this.count -= 1;@b@ Object localObject = localEntry1.value;@b@ localEntry1.value = null;@b@ releaseEntry(localEntry1);@b@@b@ return localObject;@b@ }@b@ localEntry2 = localEntry1; localEntry1 = localEntry1.next;@b@ }@b@@b@ return null;@b@ }@b@@b@ public synchronized void clear()@b@ {@b@ if (this.count == 0)@b@ return;@b@@b@ Entry[] arrayOfEntry = this.table;@b@ int i = arrayOfEntry.length;@b@ while (true) { Object localObject;@b@ while (true) { if (--i < 0)@b@ break label75;@b@ localObject = arrayOfEntry[i];@b@@b@ if (localObject != null)@b@ break;@b@ }@b@ while (((Entry)localObject).next != null)@b@ {@b@ ((Entry)localObject).value = null;@b@ releaseEntry((Entry)localObject);@b@@b@ Entry localEntry = ((Entry)localObject).next;@b@ ((Entry)localObject).next = null;@b@ localObject = localEntry;@b@ }@b@@b@ arrayOfEntry[i] = null;@b@ }@b@@b@ label75: this.count = 0;@b@ }@b@@b@ private Entry getNewEntry()@b@ {@b@ Entry localEntry;@b@ int i = this.entryCache.size();@b@ if (i == 0)@b@ localEntry = new Entry();@b@ else@b@ localEntry = (Entry)this.entryCache.remove(i - 1);@b@@b@ return localEntry;@b@ }@b@@b@ private void releaseEntry(Entry paramEntry)@b@ {@b@ this.entryCache.add(paramEntry);@b@ }@b@@b@ private static class Entry@b@ {@b@ int hash;@b@ int key;@b@ Object value;@b@ Entry next;@b@@b@ protected Entry()@b@ {@b@ }@b@@b@ protected Entry(int paramInt1, int paramInt2, Object paramObject, Entry paramEntry)@b@ {@b@ this.hash = paramInt1;@b@ this.key = paramInt2;@b@ this.value = paramObject;@b@ this.next = paramEntry;@b@ }@b@@b@ protected void set(int paramInt1, int paramInt2, Object paramObject, Entry paramEntry)@b@ {@b@ this.hash = paramInt1;@b@ this.key = paramInt2;@b@ this.value = paramObject;@b@ this.next = paramEntry;@b@ }@b@ }@b@}
package org.j3d.util;@b@@b@import java.util.Arrays;@b@@b@public class FloatHashMap@b@{@b@ private transient Entry[] table;@b@ private transient int count;@b@ private int threshold;@b@ private float loadFactor;@b@ private transient int modCount;@b@@b@ public FloatHashMap()@b@ {@b@ this(20, 0.75F);@b@ }@b@@b@ public FloatHashMap(int paramInt)@b@ {@b@ this(paramInt, 0.75F);@b@ }@b@@b@ public FloatHashMap(int paramInt, float paramFloat)@b@ {@b@ this.count = 0;@b@@b@ this.modCount = 0;@b@@b@ if (paramInt < 0)@b@ throw new IllegalArgumentException("Illegal Capacity: " + paramInt);@b@@b@ if (paramFloat <= 0.0F)@b@ throw new IllegalArgumentException("Illegal Load: " + paramFloat);@b@@b@ if (paramInt == 0)@b@ paramInt = 1;@b@@b@ this.loadFactor = paramFloat;@b@ this.table = new Entry[paramInt];@b@ this.threshold = (int)(paramInt * paramFloat);@b@ }@b@@b@ public int size()@b@ {@b@ return this.count;@b@ }@b@@b@ public boolean isEmpty()@b@ {@b@ return (this.count == 0);@b@ }@b@@b@ public boolean contains(Object paramObject)@b@ {@b@ if (paramObject == null)@b@ {@b@ throw new NullPointerException("value object may not be null!");@b@ }@b@@b@ Entry[] arrayOfEntry = this.table;@b@ int i = arrayOfEntry.length; if (i-- > 0)@b@ {@b@ Entry localEntry = arrayOfEntry[i];@b@ while (true) { if (localEntry == null);@b@ if (localEntry.value.equals(paramObject))@b@ {@b@ return true;@b@ }@b@ localEntry = localEntry.next;@b@ }@b@@b@ }@b@@b@ return false;@b@ }@b@@b@ public boolean containsValue(Object paramObject)@b@ {@b@ return contains(paramObject);@b@ }@b@@b@ public boolean containsKey(float paramFloat)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ long l = Double.doubleToLongBits(paramFloat);@b@ int i = (int)(l ^ l >>> 32);@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if ((localEntry.hash == i) && (localEntry.key == paramFloat))@b@ {@b@ return true;@b@ }@b@ }@b@ return false;@b@ }@b@@b@ public Object get(float paramFloat)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ long l = Double.doubleToLongBits(paramFloat);@b@ int i = (int)(l ^ l >>> 32);@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if ((localEntry.hash == i) && (localEntry.key == paramFloat))@b@ {@b@ return localEntry.value;@b@ }@b@ }@b@ return null;@b@ }@b@@b@ public Object put(float paramFloat, Object paramObject)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ long l = Double.doubleToLongBits(paramFloat);@b@ int i = (int)(l ^ l >>> 32);@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ for (Entry localEntry = arrayOfEntry[j]; localEntry != null; localEntry = localEntry.next)@b@ {@b@ if ((localEntry.hash == i) && (localEntry.key == paramFloat))@b@ {@b@ Object localObject = localEntry.value;@b@ localEntry.value = paramObject;@b@ return localObject;@b@ }@b@ }@b@@b@ this.modCount += 1;@b@ if (this.count >= this.threshold)@b@ {@b@ rehash();@b@@b@ arrayOfEntry = this.table;@b@ j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ }@b@@b@ localEntry = new Entry(i, paramFloat, paramObject, arrayOfEntry[j]);@b@ arrayOfEntry[j] = localEntry;@b@ this.count += 1;@b@ return null;@b@ }@b@@b@ public Object remove(float paramFloat)@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ long l = Double.doubleToLongBits(paramFloat);@b@ int i = (int)(l ^ l >>> 32);@b@ int j = (i & 0x7FFFFFFF) % arrayOfEntry.length;@b@ Entry localEntry1 = arrayOfEntry[j]; for (Entry localEntry2 = null; localEntry1 != null; )@b@ {@b@ if ((localEntry1.hash == i) && (localEntry1.key == paramFloat))@b@ {@b@ this.modCount += 1;@b@ if (localEntry2 != null)@b@ {@b@ localEntry2.next = localEntry1.next;@b@ }@b@ else@b@ arrayOfEntry[j] = localEntry1.next;@b@@b@ this.count -= 1;@b@ Object localObject = localEntry1.value;@b@ localEntry1.value = null;@b@ return localObject;@b@ }@b@ localEntry2 = localEntry1; localEntry1 = localEntry1.next;@b@ }@b@@b@ return null;@b@ }@b@@b@ public synchronized void clear()@b@ {@b@ Entry[] arrayOfEntry = this.table;@b@ this.modCount += 1;@b@ for (int i = arrayOfEntry.length; --i >= 0; )@b@ arrayOfEntry[i] = null;@b@ this.count = 0;@b@ }@b@@b@ public float[] keySet()@b@ {@b@ float[] arrayOfFloat = new float[this.count];@b@ int i = 0;@b@@b@ Entry[] arrayOfEntry = this.table;@b@ int j = arrayOfEntry.length; if (j-- > 0)@b@ {@b@ Entry localEntry = arrayOfEntry[j];@b@ while (true) { if (localEntry == null);@b@ arrayOfFloat[(i++)] = localEntry.key;@b@@b@ localEntry = localEntry.next;@b@ }@b@@b@ }@b@@b@ return arrayOfFloat;@b@ }@b@@b@ public float[] keySetSorted()@b@ {@b@ float[] arrayOfFloat = keySet();@b@ Arrays.sort(arrayOfFloat);@b@@b@ return arrayOfFloat;@b@ }@b@@b@ private void rehash()@b@ {@b@ int i = this.table.length;@b@ Entry[] arrayOfEntry1 = this.table;@b@@b@ int j = i * 2 + 1;@b@ Entry[] arrayOfEntry2 = new Entry[j];@b@@b@ this.modCount += 1;@b@ this.threshold = (int)(j * this.loadFactor);@b@ this.table = arrayOfEntry2;@b@@b@ int k = i; if (k-- > 0)@b@ {@b@ Entry localEntry1 = arrayOfEntry1[k];@b@ while (true) { if (localEntry1 == null);@b@ Entry localEntry2 = localEntry1;@b@ localEntry1 = localEntry1.next;@b@@b@ int l = (localEntry2.hash & 0x7FFFFFFF) % j;@b@ localEntry2.next = arrayOfEntry2[l];@b@ arrayOfEntry2[l] = localEntry2;@b@ }@b@ }@b@ }@b@@b@ private static class Entry@b@ {@b@ int hash;@b@ float key;@b@ Object value;@b@ Entry next;@b@@b@ protected Entry(int paramInt, float paramFloat, Object paramObject, Entry paramEntry)@b@ {@b@ this.hash = paramInt;@b@ this.key = paramFloat;@b@ this.value = paramObject;@b@ this.next = paramEntry;@b@ }@b@ }@b@}