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

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

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

ConcurrentSkipListMap.putAll介绍

暂无

代码示例

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in {@code m} are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

代码示例来源:origin: tjake/Solandra

termQueryBoundries.putAll(localRanges);

代码示例来源:origin: com.microsoft.reef/reef-io

@Override
public void putAll(Map<? extends CharSequence, ? extends T> m) {
  map.putAll(m);
}

代码示例来源:origin: com.hurence.logisland/logisland-agent

@Override
public void putAll(Map<K, V> entries) {
 store.putAll(entries);
}

代码示例来源:origin: org.apache.reef/reef-io

@Override
public void putAll(final Map<? extends CharSequence, ? extends T> m) {
 map.putAll(m);
}

代码示例来源:origin: cinchapi/concourse

/**
 * Force an incremental sort. Take all the {@link #unsorted} items and place
 * them into the {@link #sorted} collection in the correct positions. This
 * method should only be called when the client is attempting to perform
 * some action in the {@link SortedMap} interface.
 */
private void sort() {
  for (HashMap<K, V> segment : segments) {
    sorted.putAll(segment);
    segment.clear();
  }
}

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in {@code m} are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in <tt>m</tt> are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in {@code m} are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in <tt>m</tt> are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in {@code m} are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in {@code m} are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in {@code m} are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in {@code m} are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in <tt>m</tt> are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

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

/**
 * Constructs a new map containing the same mappings as the given map,
 * sorted according to the {@linkplain Comparable natural ordering} of
 * the keys.
 *
 * @param  m the map whose mappings are to be placed in this map
 * @throws ClassCastException if the keys in {@code m} are not
 *         {@link Comparable}, or are not mutually comparable
 * @throws NullPointerException if the specified map or any of its keys
 *         or values are null
 */
public ConcurrentSkipListMap(Map<? extends K, ? extends V> m) {
  this.comparator = null;
  initialize();
  putAll(m);
}

代码示例来源:origin: cinchapi/concourse

@Override
public void putAll(Map<? extends K, ? extends V> m) {
  long[] stamps = grabAllSegmentWriteLocks();
  try {
    if(m instanceof SortedMap) {
      sorted.putAll(m);
    }
    else {
      for (Entry<? extends K, ? extends V> entry : m.entrySet()) {
        int seg = getSegment(entry.getKey());
        segments[seg].put(entry.getKey(), entry.getValue());
      }
    }
  }
  finally {
    releaseSegmentLocks(stamps);
  }
}

代码示例来源:origin: NationalSecurityAgency/timely

@Override
public Accumulator<String, ConcurrentSkipListMap<String, MutableLong>> clone() {
  SortedStringAccumulator a = new SortedStringAccumulator();
  a.getLocalValue().putAll(this.values);
  return a;
}

代码示例来源:origin: org.apache.geronimo/geronimo-metrics-common

private void ensureUpToDate() {
  final long next = nextRefreshTime.get();
  final long now = System.nanoTime();
  if (now < next) {
    return;
  }
  final Lock lock = this.lock.writeLock();
  lock.lock();
  try {
    if (nextRefreshTime.compareAndSet(next, now + REFRESH_INTERVAL)) {
      final long oldStartTime = startTime;
      startTime = nowSec();
      final double updateFactor = Math.exp(-ALPHA * (startTime - oldStartTime));
      if (updateFactor != 0.) {
        bucket.putAll(new ArrayList<>(bucket.keySet()).stream()
            .collect(toMap(k -> k * updateFactor, k -> {
              final Value previous = bucket.remove(k);
              return new Value(previous.value, previous.weight * updateFactor);
            })));
        count.set(bucket.size()); // N keys can lead to the same key so we must update it
      } else {
        bucket.clear();
        count.set(0);
      }
    }
  } finally {
    lock.unlock();
  }
}

代码示例来源:origin: com.github.jnthnclt/os.lab.core

copyOfIndexes.putAll(indexes);
copyOfIndexes.put(minKey.bytes, index);
indexes = copyOfIndexes;
synchronized (copyIndexOnWrite) {
  ConcurrentSkipListMap<byte[], FileBackMergableIndexes> copyOfIndexes = new ConcurrentSkipListMap<>(rawhide.getKeyComparator());
  copyOfIndexes.putAll(indexes);
  moved = copyOfIndexes.remove(tailMap.firstKey());
  copyOfIndexes.put(minKey.bytes, moved);

相关文章

ConcurrentSkipListMap类方法