public boolean contains(Object key) { return contains(((Long) key).longValue()); }
long changeRemoved() { int mc = modCount(); long newRemoved = findNewFreeOrRemoved(); incrementModCount(); mc++; if (!noRemoved()) { LongArrays.replaceAll(set, removedValue, newRemoved); } this.removedValue = newRemoved; if (mc != modCount()) throw new ConcurrentModificationException(); return newRemoved; }
public boolean contains(long key) { return index(key) >= 0; }
long changeFree() { int mc = modCount(); long newFree = findNewFreeOrRemoved(); incrementModCount(); mc++; LongArrays.replaceAll(set, freeValue, newFree); this.freeValue = newFree; if (mc != modCount()) throw new ConcurrentModificationException(); return newFree; }
void move(SeparateKVLongQHash hash) { super.copy(hash); freeValue = hash.freeValue(); if (hash.supportRemoved()) removedValue = hash.removedValue(); set = hash.keys(); if (!hash.supportRemoved()) { removedValue = freeValue; removedValue = findNewFreeOrRemoved(); } }
long changeFree() { int mc = modCount(); long newFree = findNewFreeOrRemoved(); incrementModCount(); mc++; LongArrays.replaceAll(set, freeValue, newFree); this.freeValue = newFree; if (mc != modCount()) throw new ConcurrentModificationException(); return newFree; }
void move(SeparateKVLongQHash hash) { super.copy(hash); freeValue = hash.freeValue(); if (hash.supportRemoved()) removedValue = hash.removedValue(); set = hash.keys(); if (!hash.supportRemoved()) { removedValue = freeValue; removedValue = findNewFreeOrRemoved(); } }
long changeRemoved() { int mc = modCount(); long newRemoved = findNewFreeOrRemoved(); incrementModCount(); mc++; if (!noRemoved()) { LongArrays.replaceAll(set, removedValue, newRemoved); } this.removedValue = newRemoved; if (mc != modCount()) throw new ConcurrentModificationException(); return newRemoved; }
void copy(SeparateKVLongQHash hash) { super.copy(hash); freeValue = hash.freeValue(); if (hash.supportRemoved()) removedValue = hash.removedValue(); set = hash.keys().clone(); if (!hash.supportRemoved()) { removedValue = freeValue; removedValue = findNewFreeOrRemoved(); } }
public boolean contains(long key) { return index(key) >= 0; }
public boolean contains(Object key) { return contains(((Long) key).longValue()); }
void copy(SeparateKVLongQHash hash) { super.copy(hash); freeValue = hash.freeValue(); if (hash.supportRemoved()) removedValue = hash.removedValue(); set = hash.keys().clone(); if (!hash.supportRemoved()) { removedValue = freeValue; removedValue = findNewFreeOrRemoved(); } }
private long findNewFreeOrRemoved() { long free = this.freeValue; long removed = this.removedValue; Random random = ThreadLocalRandom.current(); long newFree; { do { newFree = (long) random.nextLong(); } while (newFree == free || newFree == removed || index(newFree) >= 0); } return newFree; }
private long findNewFreeOrRemoved() { long free = this.freeValue; long removed = this.removedValue; Random random = ThreadLocalRandom.current(); long newFree; { do { newFree = (long) random.nextLong(); } while (newFree == free || newFree == removed || index(newFree) >= 0); } return newFree; }