/** * Get the id associated with <code>key</code> or -1 if the key is not contained in the hash. */ public long find(long key) { final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1 || keys.get(id) == key) { return id; } } }
private void reset(long key, long id) { final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key); break; } } }
private long set(long key, long id) { assert size < maxSize; final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key); ++size; return id; } else if (keys.get(curId) == key) { return -1 - curId; } } }
/** * Get the id associated with <code>key</code> or -1 if the key is not contained in the hash. */ public long find(long key) { final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1 || keys.get(id) == key) { return id; } } }
/** * Get the id associated with <code>key</code> or -1 if the key is not contained in the hash. */ public long find(long key) { final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1 || keys.get(id) == key) { return id; } } }
/** * Get the id associated with <code>key</code> or -1 if the key is not contained in the hash. */ public long find(long key) { final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1 || keys.get(id) == key) { return id; } } }
/** * Get the id associated with <code>key</code> or -1 if the key is not contained in the hash. */ public long find(long key) { final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long id = id(index); if (id == -1 || keys.get(id) == key) { return id; } } }
private void reset(long key, long id) { final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key); break; } } }
private void reset(long key, long id) { final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key); break; } } }
private void reset(long key, long id) { final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key); break; } } }
private void reset(long key, long id) { final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key); break; } } }
private long set(long key, long id) { assert size < maxSize; final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key); ++size; return id; } else if (keys.get(curId) == key) { return -1 - curId; } } }
private long set(long key, long id) { assert size < maxSize; final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key); ++size; return id; } else if (keys.get(curId) == key) { return -1 - curId; } } }
private long set(long key, long id) { assert size < maxSize; final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key); ++size; return id; } else if (keys.get(curId) == key) { return -1 - curId; } } }
private long set(long key, long id) { assert size < maxSize; final long slot = slot(hash(key), mask); for (long index = slot; ; index = nextSlot(index, mask)) { final long curId = id(index); if (curId == -1) { // means unset id(index, id); append(id, key); ++size; return id; } else if (keys.get(curId) == key) { return -1 - curId; } } }