int insert(short key, V value) { short free; if (key == (free = freeValue)) { free = changeFree(); incrementModCount(); keys[index] = key; values[index] = value; postInsertHook(); return -1;
int valueIndex(@Nullable Object value) { if (value == null) return nullValueIndex(); if (isEmpty()) return -1; V val = (V) value; int index = -1; int mc = modCount(); short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { if (keys[i] != free) { if (valueEquals(val, vals[i])) { index = i; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return index; }
private int nullValueIndex() { if (isEmpty()) return -1; int index = -1; int mc = modCount(); short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { if (keys[i] != free) { if (vals[i] == null) { index = i; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return index; }
@Override public void clear() { int mc = modCount() + 1; super.clear(); if (mc != modCount()) throw new ConcurrentModificationException(); }
@Override final void copy(SeparateKVShortObjLHash hash) { int myMC = modCount(), hashMC = hash.modCount(); super.copy(hash); if (myMC != modCount() || hashMC != hash.modCount()) throw new ConcurrentModificationException(); }
@Override final void move(SeparateKVShortObjLHash hash) { int myMC = modCount(), hashMC = hash.modCount(); super.move(hash); if (myMC != modCount() || hashMC != hash.modCount()) throw new ConcurrentModificationException(); }
private int nullValueIndex() { if (isEmpty()) return -1; int index = -1; int mc = modCount(); short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { if (keys[i] != free) { if (vals[i] == null) { index = i; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return index; }
@Override public void clear() { int mc = modCount() + 1; super.clear(); if (mc != modCount()) throw new ConcurrentModificationException(); }
@Override final void copy(SeparateKVShortObjLHash hash) { int myMC = modCount(), hashMC = hash.modCount(); super.copy(hash); if (myMC != modCount() || hashMC != hash.modCount()) throw new ConcurrentModificationException(); }
@Override final void move(SeparateKVShortObjLHash hash) { int myMC = modCount(), hashMC = hash.modCount(); super.move(hash); if (myMC != modCount() || hashMC != hash.modCount()) throw new ConcurrentModificationException(); }
int valueIndex(@Nullable Object value) { if (value == null) return nullValueIndex(); if (isEmpty()) return -1; V val = (V) value; int index = -1; int mc = modCount(); short free = freeValue; short[] keys = set; V[] vals = values; for (int i = keys.length - 1; i >= 0; i--) { if (keys[i] != free) { if (valueEquals(val, vals[i])) { index = i; break; } } } if (mc != modCount()) throw new java.util.ConcurrentModificationException(); return index; }
int insert(short key, V value) { short free; if (key == (free = freeValue)) { free = changeFree(); incrementModCount(); keys[index] = key; values[index] = value; postInsertHook(); return -1;