public boolean contains(Object key) { return contains(((Integer) key).intValue()); }
int changeRemoved() { int mc = modCount(); int newRemoved = findNewFreeOrRemoved(); incrementModCount(); mc++; if (!noRemoved()) { IntArrays.replaceAllKeys(table, removedValue, newRemoved); } this.removedValue = newRemoved; if (mc != modCount()) throw new ConcurrentModificationException(); return newRemoved; }
public boolean contains(int key) { return index(key) >= 0; }
int changeFree() { int mc = modCount(); int newFree = findNewFreeOrRemoved(); incrementModCount(); mc++; IntArrays.replaceAllKeys(table, freeValue, newFree); this.freeValue = newFree; if (mc != modCount()) throw new ConcurrentModificationException(); return newFree; }
void move(ParallelKVIntQHash hash) { super.copy(hash); freeValue = hash.freeValue(); if (hash.supportRemoved()) removedValue = hash.removedValue(); table = hash.table(); if (!hash.supportRemoved()) { removedValue = freeValue; removedValue = findNewFreeOrRemoved(); } }
int changeFree() { int mc = modCount(); int newFree = findNewFreeOrRemoved(); incrementModCount(); mc++; IntArrays.replaceAllKeys(table, freeValue, newFree); this.freeValue = newFree; if (mc != modCount()) throw new ConcurrentModificationException(); return newFree; }
void move(ParallelKVIntQHash hash) { super.copy(hash); freeValue = hash.freeValue(); if (hash.supportRemoved()) removedValue = hash.removedValue(); table = hash.table(); if (!hash.supportRemoved()) { removedValue = freeValue; removedValue = findNewFreeOrRemoved(); } }
int changeRemoved() { int mc = modCount(); int newRemoved = findNewFreeOrRemoved(); incrementModCount(); mc++; if (!noRemoved()) { IntArrays.replaceAllKeys(table, removedValue, newRemoved); } this.removedValue = newRemoved; if (mc != modCount()) throw new ConcurrentModificationException(); return newRemoved; }
void copy(ParallelKVIntQHash hash) { super.copy(hash); freeValue = hash.freeValue(); if (hash.supportRemoved()) removedValue = hash.removedValue(); table = hash.table().clone(); if (!hash.supportRemoved()) { removedValue = freeValue; removedValue = findNewFreeOrRemoved(); } }
public boolean contains(int key) { return index(key) >= 0; }
public boolean contains(Object key) { return contains(((Integer) key).intValue()); }
void copy(ParallelKVIntQHash hash) { super.copy(hash); freeValue = hash.freeValue(); if (hash.supportRemoved()) removedValue = hash.removedValue(); table = hash.table().clone(); if (!hash.supportRemoved()) { removedValue = freeValue; removedValue = findNewFreeOrRemoved(); } }
private int findNewFreeOrRemoved() { int free = this.freeValue; int removed = this.removedValue; Random random = ThreadLocalRandom.current(); int newFree; { do { newFree = (int) random.nextInt() ; } while (newFree == free || newFree == removed || index(newFree) >= 0); } return newFree; }
private int findNewFreeOrRemoved() { int free = this.freeValue; int removed = this.removedValue; Random random = ThreadLocalRandom.current(); int newFree; { do { newFree = (int) random.nextInt() ; } while (newFree == free || newFree == removed || index(newFree) >= 0); } return newFree; }