java.util.concurrent.ConcurrentSkipListMap.randomLevel()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中java.util.concurrent.ConcurrentSkipListMap.randomLevel()方法的一些代码示例,展示了ConcurrentSkipListMap.randomLevel()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ConcurrentSkipListMap.randomLevel()方法的具体详情如下:
包路径:java.util.concurrent.ConcurrentSkipListMap
类名称:ConcurrentSkipListMap
方法名:randomLevel

ConcurrentSkipListMap.randomLevel介绍

[英]Returns a random level for inserting a new node. Hardwired to k=1, p=0.5, max 31 (see above and Pugh's "Skip List Cookbook", sec 3.4). This uses the simplest of the generators described in George Marsaglia's "Xorshift RNGs" paper. This is not a high-quality generator but is acceptable here.
[中]返回用于插入新节点的随机级别。硬接线至k=1,p=0.5,最大31(见上文和Pugh的“跳过列表食谱”,第3.4节)。这使用了George Marsaglia的“Xorshift RNGs”论文中描述的最简单的生成器。这不是一个高质量的发电机,但在这里是可以接受的。

代码示例

代码示例来源:origin: robovm/robovm

while (it.hasNext()) {
  Map.Entry<? extends K, ? extends V> e = it.next();
  int j = randomLevel();
  if (j > h.level) j = h.level + 1;
  K k = e.getKey();

代码示例来源:origin: robovm/robovm

K key = (K) k;
V val = (V) v;
int j = randomLevel();
if (j > h.level) j = h.level + 1;
Node<K,V> z = new Node<K,V>(key, val, null);

代码示例来源:origin: robovm/robovm

if (!b.casNext(n, z))
  break;         // restart if lost race to append to b
int level = randomLevel();
if (level > 0)
  insertIndex(z, level);

代码示例来源:origin: MobiVM/robovm

while (it.hasNext()) {
  Map.Entry<? extends K, ? extends V> e = it.next();
  int j = randomLevel();
  if (j > h.level) j = h.level + 1;
  K k = e.getKey();

代码示例来源:origin: ibinti/bugvm

while (it.hasNext()) {
  Map.Entry<? extends K, ? extends V> e = it.next();
  int j = randomLevel();
  if (j > h.level) j = h.level + 1;
  K k = e.getKey();

代码示例来源:origin: com.jtransc/jtransc-rt

while (it.hasNext()) {
  Map.Entry<? extends K, ? extends V> e = it.next();
  int j = randomLevel();
  if (j > h.level) j = h.level + 1;
  K k = e.getKey();

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

while (it.hasNext()) {
  Map.Entry<? extends K, ? extends V> e = it.next();
  int j = randomLevel();
  if (j > h.level) j = h.level + 1;
  K k = e.getKey();

代码示例来源:origin: com.gluonhq/robovm-rt

while (it.hasNext()) {
  Map.Entry<? extends K, ? extends V> e = it.next();
  int j = randomLevel();
  if (j > h.level) j = h.level + 1;
  K k = e.getKey();

代码示例来源:origin: MobiVM/robovm

K key = (K) k;
V val = (V) v;
int j = randomLevel();
if (j > h.level) j = h.level + 1;
Node<K,V> z = new Node<K,V>(key, val, null);

代码示例来源:origin: ibinti/bugvm

K key = (K) k;
V val = (V) v;
int j = randomLevel();
if (j > h.level) j = h.level + 1;
Node<K,V> z = new Node<K,V>(key, val, null);

代码示例来源:origin: com.bugvm/bugvm-rt

K key = (K) k;
V val = (V) v;
int j = randomLevel();
if (j > h.level) j = h.level + 1;
Node<K,V> z = new Node<K,V>(key, val, null);

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

K key = (K) k;
V val = (V) v;
int j = randomLevel();
if (j > h.level) j = h.level + 1;
Node<K,V> z = new Node<K,V>(key, val, null);

代码示例来源:origin: MobiVM/robovm

if (!b.casNext(n, z))
  break;         // restart if lost race to append to b
int level = randomLevel();
if (level > 0)
  insertIndex(z, level);

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

if (!b.casNext(n, z))
  break;         // restart if lost race to append to b
int level = randomLevel();
if (level > 0)
  insertIndex(z, level);

代码示例来源:origin: com.bugvm/bugvm-rt

if (!b.casNext(n, z))
  break;         // restart if lost race to append to b
int level = randomLevel();
if (level > 0)
  insertIndex(z, level);

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

if (!b.casNext(n, z))
  break;         // restart if lost race to append to b
int level = randomLevel();
if (level > 0)
  insertIndex(z, level);

代码示例来源:origin: com.jtransc/jtransc-rt

if (!b.casNext(n, z))
  break;         // restart if lost race to append to b
int level = randomLevel();
if (level > 0)
  insertIndex(z, level);

代码示例来源:origin: ibinti/bugvm

if (!b.casNext(n, z))
  break;         // restart if lost race to append to b
int level = randomLevel();
if (level > 0)
  insertIndex(z, level);

代码示例来源:origin: jtulach/bck2brwsr

if (!b.casNext(n, z))
  break;         // restart if lost race to append to b
int level = randomLevel();
if (level > 0)
  insertIndex(z, level);

代码示例来源:origin: FlexoVM/flexovm

if (!b.casNext(n, z))
  break;         // restart if lost race to append to b
int level = randomLevel();
if (level > 0)
  insertIndex(z, level);

相关文章

ConcurrentSkipListMap类方法