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

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

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

ConcurrentSkipListMap.doPut介绍

[英]Main insertion method. Adds element if not present, or replaces value if present and onlyIfAbsent is false.
[中]主插入法。如果不存在,则添加元素;如果存在且onlyFabSent为false,则替换值。

代码示例

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

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

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

/**
 * Associates the specified value with the specified key in this map.
 * If the map previously contained a mapping for the key, the old
 * value is replaced.
 *
 * @param key key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with the specified key, or
 *         {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V put(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, false);
}

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

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

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

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or <tt>null</tt> if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

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

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

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

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or <tt>null</tt> if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

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

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or <tt>null</tt> if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

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

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

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

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

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

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

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

/**
 * {@inheritDoc}
 *
 * @return the previous value associated with the specified key,
 *         or {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V putIfAbsent(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, true);
}

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

/**
 * Associates the specified value with the specified key in this map.
 * If the map previously contained a mapping for the key, the old
 * value is replaced.
 *
 * @param key key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with the specified key, or
 *         {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V put(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, false);
}

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

/**
 * Associates the specified value with the specified key in this map.
 * If the map previously contained a mapping for the key, the old
 * value is replaced.
 *
 * @param key key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with the specified key, or
 *         {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V put(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, false);
}

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

/**
 * Associates the specified value with the specified key in this map.
 * If the map previously contained a mapping for the key, the old
 * value is replaced.
 *
 * @param key key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with the specified key, or
 *         {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V put(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, false);
}

代码示例来源:origin: org.apidesign.bck2brwsr/emul

/**
 * Associates the specified value with the specified key in this map.
 * If the map previously contained a mapping for the key, the old
 * value is replaced.
 *
 * @param key key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with the specified key, or
 *         <tt>null</tt> if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V put(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, false);
}

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

/**
 * Associates the specified value with the specified key in this map.
 * If the map previously contained a mapping for the key, the old
 * value is replaced.
 *
 * @param key key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with the specified key, or
 *         {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V put(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, false);
}

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

/**
 * Associates the specified value with the specified key in this map.
 * If the map previously contained a mapping for the key, the old
 * value is replaced.
 *
 * @param key key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with the specified key, or
 *         <tt>null</tt> if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V put(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, false);
}

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

/**
 * Associates the specified value with the specified key in this map.
 * If the map previously contained a mapping for the key, the old
 * value is replaced.
 *
 * @param key key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with the specified key, or
 *         {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V put(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, false);
}

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

/**
 * Associates the specified value with the specified key in this map.
 * If the map previously contained a mapping for the key, the old
 * value is replaced.
 *
 * @param key key with which the specified value is to be associated
 * @param value value to be associated with the specified key
 * @return the previous value associated with the specified key, or
 *         {@code null} if there was no mapping for the key
 * @throws ClassCastException if the specified key cannot be compared
 *         with the keys currently in the map
 * @throws NullPointerException if the specified key or value is null
 */
public V put(K key, V value) {
  if (value == null)
    throw new NullPointerException();
  return doPut(key, value, false);
}

相关文章

ConcurrentSkipListMap类方法