public void removeExpired() { synchronized (this) { expungeStaleEntries(); } }
public void removeExpired() { synchronized (this) { expungeStaleEntries(); } }
public void removeExpired() { synchronized (this) { expungeStaleEntries(); } }
public void removeExpired() { synchronized (this) { expungeStaleEntries(); } }
public Map.Entry removeRandom() { synchronized (this) { expungeStaleEntries(); if (count == 0) return null; int random = randomEntryIndex(); int index = findEntry(random, random % 2 == 0, false); if (index == -1) return null; Entry rem = table[index]; table[index] = rem.getNext(); count--; return rem; } }
public Map.Entry removeRandom() { synchronized (this) { expungeStaleEntries(); if (count == 0) return null; int random = randomEntryIndex(); int index = findEntry(random, random % 2 == 0, false); if (index == -1) return null; Entry rem = table[index]; table[index] = rem.getNext(); count--; return rem; } }
public Map.Entry removeRandom() { synchronized (this) { expungeStaleEntries(); if (count == 0) return null; int random = randomEntryIndex(); int index = findEntry(random, random % 2 == 0, false); if (index == -1) return null; Entry rem = table[index]; table[index] = rem.getNext(); count--; return rem; } }
public Map.Entry removeRandom() { synchronized (this) { expungeStaleEntries(); if (count == 0) return null; int random = randomEntryIndex(); int index = findEntry(random, random % 2 == 0, false); if (index == -1) return null; Entry rem = table[index]; table[index] = rem.getNext(); count--; return rem; } }
/** * Returns a shallow copy of this HashMap. The keys and values * themselves are not cloned. */ public synchronized Object clone() { try { expungeStaleEntries(); ConcurrentReferenceHashMap t = (ConcurrentReferenceHashMap) super.clone(); t.table = new Entry[table.length]; for (int i = table.length; i-- > 0;) { Entry e = table[i]; if (e != null) { t.table[i] = (Entry) e.clone(t.queue); e = e.getNext(); for (Entry k = t.table[i]; e != null; e = e.getNext()) { k.setNext((Entry) e.clone(t.queue)); k = k.getNext(); } } } t.keySet = null; t.entrySet = null; t.values = null; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
/** * Returns a shallow copy of this HashMap. The keys and values * themselves are not cloned. */ public synchronized Object clone() { try { expungeStaleEntries(); ConcurrentReferenceHashMap t = (ConcurrentReferenceHashMap) super.clone(); t.table = new Entry[table.length]; for (int i = table.length; i-- > 0;) { Entry e = table[i]; if (e != null) { t.table[i] = (Entry) e.clone(t.queue); e = e.getNext(); for (Entry k = t.table[i]; e != null; e = e.getNext()) { k.setNext((Entry) e.clone(t.queue)); k = k.getNext(); } } } t.keySet = null; t.entrySet = null; t.values = null; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
/** * Returns a shallow copy of this HashMap. The keys and values * themselves are not cloned. */ public synchronized Object clone() { try { expungeStaleEntries(); ConcurrentReferenceHashMap t = (ConcurrentReferenceHashMap) super.clone(); t.table = new Entry[table.length]; for (int i = table.length; i-- > 0;) { Entry e = table[i]; if (e != null) { t.table[i] = (Entry) e.clone(t.queue); e = e.getNext(); for (Entry k = t.table[i]; e != null; e = e.getNext()) { k.setNext((Entry) e.clone(t.queue)); k = k.getNext(); } } } t.keySet = null; t.entrySet = null; t.values = null; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }
/** * Returns a shallow copy of this HashMap. The keys and values * themselves are not cloned. */ public synchronized Object clone() { try { expungeStaleEntries(); ConcurrentReferenceHashMap t = (ConcurrentReferenceHashMap) super.clone(); t.table = new Entry[table.length]; for (int i = table.length; i-- > 0;) { Entry e = table[i]; if (e != null) { t.table[i] = (Entry) e.clone(t.queue); e = e.getNext(); for (Entry k = t.table[i]; e != null; e = e.getNext()) { k.setNext((Entry) e.clone(t.queue)); k = k.getNext(); } } } t.keySet = null; t.entrySet = null; t.values = null; return t; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable throw new InternalError(); } }