当前位置: 首页>>代码示例>>Java>>正文


Java HashCommon.murmurHash3方法代码示例

本文整理汇总了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;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:22,代码来源:S2BTightTraverseMap.java

示例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++;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:23,代码来源:S2BTightTraverseMap.java

示例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;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:20,代码来源:S2BTightTraverseMap.java

示例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;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:22,代码来源:S2BTraverseMap.java

示例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++;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:24,代码来源:S2BTraverseMap.java

示例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;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:20,代码来源:S2BTraverseMap.java

示例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++;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:24,代码来源:S2STraverseMap.java

示例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;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:19,代码来源:S2STraverseMap.java

示例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++;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:24,代码来源:S2ITraverseMap.java

示例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;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:20,代码来源:S2ITraverseMap.java

示例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;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:21,代码来源:S2STightTraverseMap.java

示例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++;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:23,代码来源:S2STightTraverseMap.java

示例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;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:19,代码来源:S2STightTraverseMap.java

示例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;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:33,代码来源:S2BTightTraverseMap.java

示例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;
}
 
开发者ID:Tencent,项目名称:angel,代码行数:34,代码来源:S2BTraverseMap.java


注:本文中的it.unimi.dsi.fastutil.HashCommon.murmurHash3方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。