java.util.HashMap.addNewEntryForNullKey()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(209)

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

HashMap.addNewEntryForNullKey介绍

[英]Creates a new entry for the null key, and the given value and inserts it into the hash table. This method is called by put (and indirectly, putAll), and overridden by LinkedHashMap.
[中]为空键和给定值创建一个新条目,并将其插入哈希表。此方法由put调用(并间接地由putAll调用),并由LinkedHashMap重写。

代码示例

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

private V putValueForNullKey(V value) {
  HashMapEntry<K, V> entry = entryForNullKey;
  if (entry == null) {
    addNewEntryForNullKey(value);
    size++;
    modCount++;
    return null;
  } else {
    preModify(entry);
    V oldValue = entry.value;
    entry.value = value;
    return oldValue;
  }
}

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

private V putValueForNullKey(V value) {
  HashMapEntry<K, V> entry = entryForNullKey;
  if (entry == null) {
    addNewEntryForNullKey(value);
    size++;
    modCount++;
    return null;
  } else {
    preModify(entry);
    V oldValue = entry.value;
    entry.value = value;
    return oldValue;
  }
}

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

private V putValueForNullKey(V value) {
  HashMapEntry<K, V> entry = entryForNullKey;
  if (entry == null) {
    addNewEntryForNullKey(value);
    size++;
    modCount++;
    return null;
  } else {
    preModify(entry);
    V oldValue = entry.value;
    entry.value = value;
    return oldValue;
  }
}

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

private V putValueForNullKey(V value) {
  HashMapEntry<K, V> entry = entryForNullKey;
  if (entry == null) {
    addNewEntryForNullKey(value);
    size++;
    modCount++;
    return null;
  } else {
    preModify(entry);
    V oldValue = entry.value;
    entry.value = value;
    return oldValue;
  }
}

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

private V putValueForNullKey(V value) {
  HashMapEntry<K, V> entry = entryForNullKey;
  if (entry == null) {
    addNewEntryForNullKey(value);
    size++;
    modCount++;
    return null;
  } else {
    preModify(entry);
    V oldValue = entry.value;
    entry.value = value;
    return oldValue;
  }
}

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

private V putValueForNullKey(V value) {
  HashMapEntry<K, V> entry = entryForNullKey;
  if (entry == null) {
    addNewEntryForNullKey(value);
    size++;
    modCount++;
    return null;
  } else {
    preModify(entry);
    V oldValue = entry.value;
    entry.value = value;
    return oldValue;
  }
}

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

private V putValueForNullKey(V value) {
  HashMapEntry<K, V> entry = entryForNullKey;
  if (entry == null) {
    addNewEntryForNullKey(value);
    size++;
    modCount++;
    return null;
  } else {
    preModify(entry);
    V oldValue = entry.value;
    entry.value = value;
    return oldValue;
  }
}

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

private V putValueForNullKey(V value) {
  HashMapEntry<K, V> entry = entryForNullKey;
  if (entry == null) {
    addNewEntryForNullKey(value);
    size++;
    modCount++;
    return null;
  } else {
    preModify(entry);
    V oldValue = entry.value;
    entry.value = value;
    return oldValue;
  }
}

相关文章