本文整理汇总了Java中it.unimi.dsi.fastutil.HashCommon.murmurHash3方法的典型用法代码示例。如果您正苦于以下问题:Java HashCommon.murmurHash3方法的具体用法?Java HashCommon.murmurHash3怎么用?Java HashCommon.murmurHash3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类it.unimi.dsi.fastutil.HashCommon
的用法示例。
在下文中一共展示了HashCommon.murmurHash3方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: get
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
@Override
public short get(short k) {
// The starting point
int pos = (HashCommon.murmurHash3(k)) & mask;
// There's always an unused entry.
int cnt = 0;
while (used(pos)) {
if (key[pos] == k) {
return values[pos];
}
pos = (pos + 1) & mask;
cnt++;
if (cnt > n) {
rehash();
return get(k);
}
}
return 0;
}
示例2: put
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
public void put(short k, byte v) {
if (v == 0)
return;
// The starting point
int pos = (HashCommon.murmurHash3(k)) & mask;
// There's always an unused entry.
while (used(pos)) {
if (key[pos] == k) {
values[pos] = v;
return;
}
pos = (pos + 1) & mask;
}
key[pos] = k;
values[pos] = v;
values[idx(size)] = (byte) pos;
values[poss(pos)] = (byte) size;
size++;
}
示例3: dec
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
@Override
public short dec(short k) {
int pos = (HashCommon.murmurHash3(k)) & mask;
while (used(pos)) {
if (key[pos] == k) {
values[pos]--;
if (values[pos] == 0) {
size--;
values[idx(values[poss(pos)])] = values[idx(size)];
values[poss(values[idx(size)])] = values[poss(pos)];
}
return values[pos];
}
pos = (pos + 1) & mask;
}
return 0;
}
示例4: get
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
@Override
public short get(short k) {
// The starting point
int pos = (HashCommon.murmurHash3(k)) & mask;
// There's always an unused entry.
int cnt = 0;
while (used[pos]) {
if (key[pos] == k) {
return value[pos];
}
pos = (pos + 1) & mask;
cnt++;
if (cnt > n) {
rehash();
return get(k);
}
}
return 0;
}
示例5: put
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
public void put(short k, byte v) {
if (v == 0)
return;
// The starting point
int pos = (HashCommon.murmurHash3(k)) & mask;
// There's always an unused entry.
while (used[pos]) {
if (key[pos] == k) {
value[pos] = v;
return;
}
pos = (pos + 1) & mask;
}
used[pos] = true;
key[pos] = k;
value[pos] = v;
idx[size] = (byte) pos;
poss[(byte) pos] = (byte) size;
size++;
}
示例6: dec
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
@Override
public short dec(short k) {
int pos = (HashCommon.murmurHash3(k)) & mask;
while (used[pos]) {
if (key[pos] == k) {
value[pos]--;
if (value[pos] == 0) {
size--;
idx[poss[pos]] = idx[size];
poss[idx[size]] = poss[pos];
}
return value[pos];
}
pos = (pos + 1) & mask;
}
return 0;
}
示例7: put
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
public void put(final short k, final short v) {
if (v == 0)
return;
// The starting point
int pos = (HashCommon.murmurHash3(k)) & mask;
// There's always an unused entry.
while (used[pos]) {
if (key[pos] == k) {
value[pos] = v;
return;
}
pos = (pos + 1) & mask;
}
used[pos] = true;
key[pos] = k;
value[pos] = v;
idx[size] = (short) pos;
poss[(short) pos] = size;
size++;
}
示例8: dec
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
public short dec(final short k) {
int pos = (HashCommon.murmurHash3(k)) & mask;
while (used[pos]) {
if (key[pos] == k) {
value[pos]--;
if (value[pos] == 0) {
size--;
idx[poss[pos]] = idx[size];
poss[idx[size]] = poss[pos];
}
return value[pos];
}
pos = (pos + 1) & mask;
}
return 0;
}
示例9: put
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
public void put(short k, int v) {
if (v == 0)
return;
// The starting point
int pos = (HashCommon.murmurHash3(k)) & mask;
// There's always an unused entry.
while (used[pos]) {
if (key[pos] == k) {
value[pos] = v;
return;
}
pos = (pos + 1) & mask;
}
used[pos] = true;
key[pos] = k;
value[pos] = v;
idx[size] = (short) pos;
poss[(short) pos] = size;
size++;
}
示例10: dec
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
@Override
public short dec(short k) {
int pos = (HashCommon.murmurHash3(k)) & mask;
while (used[pos]) {
if (key[pos] == k) {
value[pos]--;
if (value[pos] == 0) {
size--;
idx[poss[pos]] = idx[size];
poss[idx[size]] = poss[pos];
}
return (short) value[pos];
}
pos = (pos + 1) & mask;
}
return 0;
}
示例11: get
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
public short get(final short k) {
// The starting point
int pos = (HashCommon.murmurHash3(k)) & mask;
// There's always an unused entry.
int cnt = 0;
while (used(pos)) {
if (key[pos] == k) {
return values[pos];
}
pos = (pos + 1) & mask;
cnt++;
if (cnt > n) {
rehash();
return get(k);
}
}
return 0;
}
示例12: put
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
public void put(final short k, final short v) {
if (v == 0)
return;
// The starting point
int pos = (HashCommon.murmurHash3(k)) & mask;
// There's always an unused entry.
while (used(pos)) {
if (key[pos] == k) {
values[pos] = v;
return;
}
pos = (pos + 1) & mask;
}
key[pos] = k;
values[pos] = v;
values[size + n] = (short) pos;
values[(short) pos + n * 2] = size;
size++;
}
示例13: dec
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
public short dec(final short k) {
int pos = (HashCommon.murmurHash3(k)) & mask;
while (used(pos)) {
if (key[pos] == k) {
values[pos]--;
if (values[pos] == 0) {
size--;
values[idx(values[poss(pos)])] = values[idx(size)];
values[poss(values[idx(size)])] = values[poss(pos)];
}
return values[pos];
}
pos = (pos + 1) & mask;
}
return 0;
}
示例14: inc
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
@Override
public short inc(short k) {
int pos = (HashCommon.murmurHash3(k)) & mask;
int cnt = 0;
while (used(pos)) {
if (key[pos] == k) {
values[pos]++;
if (values[pos] == 1) {
values[idx(size)] = (byte) pos;
values[poss(pos)] = (byte) size;
size++;
}
return values[pos];
}
cnt++;
if (cnt > n) {
rehash();
return inc(k);
}
pos = (pos + 1) & mask;
}
key[pos] = k;
values[pos] = 1;
values[idx(size)] = (byte) pos;
values[poss(pos)] = (byte) size;
size++;
return 1;
}
示例15: inc
import it.unimi.dsi.fastutil.HashCommon; //导入方法依赖的package包/类
@Override
public short inc(short k) {
int pos = (HashCommon.murmurHash3(k)) & mask;
int cnt = 0;
while (used[pos]) {
if (key[pos] == k) {
value[pos]++;
if (value[pos] == 1) {
idx[size] = (byte) pos;
poss[(byte) pos] = (byte) size;
size++;
}
return value[pos];
}
cnt++;
if (cnt > n) {
rehash();
return inc(k);
}
pos = (pos + 1) & mask;
}
key[pos] = k;
value[pos] = 1;
used[pos] = true;
idx[size] = (byte) pos;
poss[(byte) pos] = (byte) size;
size++;
return 1;
}