org.luaj.vm2.LuaTable.hashSlot()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(79)

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

LuaTable.hashSlot介绍

[英]Find the hashtable slot to use
[中]找到要使用的哈希表槽

代码示例

代码示例来源:origin: hsllany/HtmlNative

/** 
 * Find the hashtable slot to use
 * @param key key to look for
 * @return slot to use
 */
private int hashSlot(LuaValue key) {
  return hashSlot( key, hash.length - 1 );
}

代码示例来源:origin: M66B/XPrivacyLua

/** 
 * Find the hashtable slot to use
 * @param key key to look for
 * @return slot to use
 */
private int hashSlot(LuaValue key) {
  return hashSlot( key, hash.length - 1 );
}

代码示例来源:origin: mirkosertic/GameComposer

/** 
 * Find the hashtable slot to use
 * @param key key to look for
 * @return slot to use
 */
private int hashSlot(LuaValue key) {
  return hashSlot( key, hash.length - 1 );
}

代码示例来源:origin: mirkosertic/GameComposer

@Override
public int keyindex( int mask ) {
  return hashSlot( key, mask );
}

代码示例来源:origin: hsllany/HtmlNative

public int keyindex( int mask ) {
  return hashSlot( key, mask );
}

代码示例来源:origin: M66B/XPrivacyLua

public int keyindex( int mask ) {
  return hashSlot( key, mask );
}

代码示例来源:origin: mirkosertic/GameComposer

@Override
public int keyindex( int hashMask ) {
  return hashSlot( key, hashMask );
}

代码示例来源:origin: M66B/XPrivacyLua

public int keyindex( int hashMask ) {
  return hashSlot( key, hashMask );
}

代码示例来源:origin: hsllany/HtmlNative

public int keyindex( int hashMask ) {
  return hashSlot( key, hashMask );
}

代码示例来源:origin: mirkosertic/GameComposer

@Override
public int keyindex( int mask ) {
  return LuaTable.hashSlot( strongkey(), mask );
}

代码示例来源:origin: hsllany/HtmlNative

public int keyindex( int mask ) {
  return LuaTable.hashSlot( strongkey(), mask );
}

代码示例来源:origin: M66B/XPrivacyLua

public int keyindex( int mask ) {
  return LuaTable.hashSlot( strongkey(), mask );
}

代码示例来源:origin: M66B/XPrivacyLua

protected LuaValue hashget(LuaValue key) {
  if ( hashEntries > 0 ) {
    for ( Slot slot = hash[ hashSlot(key) ]; slot != null; slot = slot.rest() ) {
      StrongSlot foundSlot;
      if ( ( foundSlot = slot.find(key) ) != null ) {
        return foundSlot.value();
      }
    }
  }
  return NIL;
}

代码示例来源:origin: mirkosertic/GameComposer

protected LuaValue hashget(LuaValue key) {
  if ( hashEntries > 0 ) {
    for ( Slot slot = hash[ hashSlot(key) ]; slot != null; slot = slot.rest() ) {
      StrongSlot foundSlot;
      if ( ( foundSlot = slot.find(key) ) != null ) {
        return foundSlot.value();
      }
    }
  }
  return NIL;
}

代码示例来源:origin: M66B/XPrivacyLua

private void hashRemove( LuaValue key ) {
  if ( hash.length > 0 ) {
    int index = hashSlot(key);
    for ( Slot slot = hash[index]; slot != null; slot = slot.rest() ) {
      StrongSlot foundSlot;
      if ( ( foundSlot = slot.find( key ) ) != null ) {
        hash[index] = hash[index].remove( foundSlot );
        --hashEntries;
        return;
      }
    }
  }
}

代码示例来源:origin: hsllany/HtmlNative

protected LuaValue hashget(LuaValue key) {
  if ( hashEntries > 0 ) {
    for ( Slot slot = hash[ hashSlot(key) ]; slot != null; slot = slot.rest() ) {
      StrongSlot foundSlot;
      if ( ( foundSlot = slot.find(key) ) != null ) {
        return foundSlot.value();
      }
    }
  }
  return NIL;
}

代码示例来源:origin: hsllany/HtmlNative

private void hashRemove( LuaValue key ) {
  if ( hash.length > 0 ) {
    int index = hashSlot(key);
    for ( Slot slot = hash[index]; slot != null; slot = slot.rest() ) {
      StrongSlot foundSlot;
      if ( ( foundSlot = slot.find( key ) ) != null ) {
        hash[index] = hash[index].remove( foundSlot );
        --hashEntries;
        return;
      }
    }
  }
}

代码示例来源:origin: mirkosertic/GameComposer

private void hashRemove( LuaValue key ) {
  if ( hash.length > 0 ) {
    int index = hashSlot(key);
    for ( Slot slot = hash[index]; slot != null; slot = slot.rest() ) {
      StrongSlot foundSlot;
      if ( ( foundSlot = slot.find( key ) ) != null ) {
        hash[index] = hash[index].remove( foundSlot );
        --hashEntries;
        return;
      }
    }
  }
}

代码示例来源:origin: M66B/XPrivacyLua

int index = 0;
if ( hash.length > 0 ) {
  index = hashSlot( key );
  for ( Slot slot = hash[ index ]; slot != null; slot = slot.rest() ) {
    StrongSlot foundSlot;
    rehash( -1 );
  index = hashSlot( key );

代码示例来源:origin: hsllany/HtmlNative

int index = 0;
if ( hash.length > 0 ) {
  index = hashSlot( key );
  for ( Slot slot = hash[ index ]; slot != null; slot = slot.rest() ) {
    StrongSlot foundSlot;
    rehash( -1 );
  index = hashSlot( key );

相关文章

微信公众号

最新文章

更多