@Override public void clear() { buckets = createEntryListArray(INITAL_CAPACITY); n = 0; }
public FlexibleHashMap(AbstractEqualityComparator<? super K> comparator, int initialCapacity, int initialBucketCapacity) { if (comparator == null) { comparator = ObjectEqualityComparator.INSTANCE; } this.comparator = comparator; this.buckets = createEntryListArray(initialBucketCapacity); this.initialBucketCapacity = initialBucketCapacity; }
protected void expand() { LinkedList<Entry<K, V>>[] old = buckets; currentPrime += 4; int newCapacity = buckets.length * 2; LinkedList<Entry<K, V>>[] newTable = createEntryListArray(newCapacity); buckets = newTable; threshold = (int)(newCapacity * LOAD_FACTOR); // System.out.println("new size="+newCapacity+", thres="+threshold); // rehash all existing entries int oldSize = size(); for (LinkedList<Entry<K, V>> bucket : old) { if ( bucket==null ) continue; for (Entry<K, V> e : bucket) { if ( e==null ) break; put(e.key, e.value); } } n = oldSize; }
@Override public void clear() { buckets = createEntryListArray(INITAL_CAPACITY); n = 0; }
public FlexibleHashMap(AbstractEqualityComparator<? super K> comparator, int initialCapacity, int initialBucketCapacity) { if (comparator == null) { comparator = ObjectEqualityComparator.INSTANCE; } this.comparator = comparator; this.buckets = createEntryListArray(initialBucketCapacity); this.initialBucketCapacity = initialBucketCapacity; }
public FlexibleHashMap(AbstractEqualityComparator<? super K> comparator, int initialCapacity, int initialBucketCapacity) { if (comparator == null) { comparator = ObjectEqualityComparator.INSTANCE; } this.comparator = comparator; this.buckets = createEntryListArray(initialBucketCapacity); this.initialBucketCapacity = initialBucketCapacity; }
@Override public void clear() { buckets = createEntryListArray(INITAL_CAPACITY); n = 0; }
@Override public void clear() { buckets = createEntryListArray(INITAL_CAPACITY); n = 0; }
@Override public void clear() { buckets = createEntryListArray(INITAL_CAPACITY); n = 0; }
public FlexibleHashMap(AbstractEqualityComparator<? super K> comparator, int initialCapacity, int initialBucketCapacity) { if (comparator == null) { comparator = ObjectEqualityComparator.INSTANCE; } this.comparator = comparator; this.buckets = createEntryListArray(initialBucketCapacity); this.initialBucketCapacity = initialBucketCapacity; }
public FlexibleHashMap(@Nullable AbstractEqualityComparator<? super K> comparator, int initialCapacity, int initialBucketCapacity) { if (comparator == null) { comparator = ObjectEqualityComparator.INSTANCE; } this.comparator = comparator; this.buckets = createEntryListArray(initialBucketCapacity); this.initialBucketCapacity = initialBucketCapacity; }
protected void expand() { LinkedList<Entry<K, V>>[] old = buckets; currentPrime += 4; int newCapacity = buckets.length * 2; LinkedList<Entry<K, V>>[] newTable = createEntryListArray(newCapacity); buckets = newTable; threshold = (int)(newCapacity * LOAD_FACTOR); // System.out.println("new size="+newCapacity+", thres="+threshold); // rehash all existing entries int oldSize = size(); for (LinkedList<Entry<K, V>> bucket : old) { if ( bucket==null ) continue; for (Entry<K, V> e : bucket) { if ( e==null ) break; put(e.key, e.value); } } n = oldSize; }
protected void expand() { LinkedList<Entry<K, V>>[] old = buckets; currentPrime += 4; int newCapacity = buckets.length * 2; LinkedList<Entry<K, V>>[] newTable = createEntryListArray(newCapacity); buckets = newTable; threshold = (int)(newCapacity * LOAD_FACTOR); // System.out.println("new size="+newCapacity+", thres="+threshold); // rehash all existing entries int oldSize = size(); for (LinkedList<Entry<K, V>> bucket : old) { if ( bucket==null ) continue; for (Entry<K, V> e : bucket) { if ( e==null ) break; put(e.key, e.value); } } n = oldSize; }
protected void expand() { LinkedList<Entry<K, V>>[] old = buckets; currentPrime += 4; int newCapacity = buckets.length * 2; LinkedList<Entry<K, V>>[] newTable = createEntryListArray(newCapacity); buckets = newTable; threshold = (int)(newCapacity * LOAD_FACTOR); // System.out.println("new size="+newCapacity+", thres="+threshold); // rehash all existing entries int oldSize = size(); for (LinkedList<Entry<K, V>> bucket : old) { if ( bucket==null ) continue; for (Entry<K, V> e : bucket) { if ( e==null ) break; put(e.key, e.value); } } n = oldSize; }
protected void expand() { LinkedList<Entry<K, V>>[] old = buckets; currentPrime += 4; int newCapacity = buckets.length * 2; LinkedList<Entry<K, V>>[] newTable = createEntryListArray(newCapacity); buckets = newTable; threshold = (int)(newCapacity * LOAD_FACTOR); // System.out.println("new size="+newCapacity+", thres="+threshold); // rehash all existing entries int oldSize = size(); for (LinkedList<Entry<K, V>> bucket : old) { if ( bucket==null ) continue; for (Entry<K, V> e : bucket) { if ( e==null ) break; put(e.key, e.value); } } n = oldSize; }