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

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

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

HashMap.preModify介绍

[英]Give LinkedHashMap a chance to take action when we modify an existing entry.
[中]当我们修改现有条目时,给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: robovm/robovm

for (HashMapEntry<K, V> e = tab[index]; e != null; e = e.next) {
  if (e.hash == hash && key.equals(e.key)) {
    preModify(e);
    V oldValue = e.value;
    e.value = value;

代码示例来源: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.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: 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.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: 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;
  }
}

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

for (HashMapEntry<K, V> e = tab[index]; e != null; e = e.next) {
  if (e.hash == hash && key.equals(e.key)) {
    preModify(e);
    V oldValue = e.value;
    e.value = value;

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

for (HashMapEntry<K, V> e = tab[index]; e != null; e = e.next) {
  if (e.hash == hash && key.equals(e.key)) {
    preModify(e);
    V oldValue = e.value;
    e.value = value;

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

for (HashMapEntry<K, V> e = tab[index]; e != null; e = e.next) {
  if (e.hash == hash && key.equals(e.key)) {
    preModify(e);
    V oldValue = e.value;
    e.value = value;

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

for (HashMapEntry<K, V> e = tab[index]; e != null; e = e.next) {
  if (e.hash == hash && key.equals(e.key)) {
    preModify(e);
    V oldValue = e.value;
    e.value = value;

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

for (HashMapEntry<K, V> e = tab[index]; e != null; e = e.next) {
  if (e.hash == hash && key.equals(e.key)) {
    preModify(e);
    V oldValue = e.value;
    e.value = value;

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

for (HashMapEntry<K, V> e = tab[index]; e != null; e = e.next) {
  if (e.hash == hash && key.equals(e.key)) {
    preModify(e);
    V oldValue = e.value;
    e.value = value;

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

for (HashMapEntry<K, V> e = tab[index]; e != null; e = e.next) {
  if (e.hash == hash && key.equals(e.key)) {
    preModify(e);
    V oldValue = e.value;
    e.value = value;

相关文章