public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }
public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }
public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }
public Iterator randomEntryIterator() { // pass index so calculated before iterator refs table, in case table // gets replace with a larger one return new HashIterator(ENTRIES, randomEntryIndex()); }
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; } }