java.util.AbstractMap.put()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.3k)|赞(0)|评价(0)|浏览(113)

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

AbstractMap.put介绍

[英]This base implementation throws UnsupportedOperationException.
[中]此基本实现引发UnsupportedOperationException。

代码示例

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

/**
 * {@inheritDoc}
 *
 * <p>This implementation iterates through {@code map}'s entry set, calling
 * {@code put()} for each.
 */
public void putAll(Map<? extends K, ? extends V> map) {
  for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
    put(entry.getKey(), entry.getValue());
  }
}

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

/**
 * Reset the values of the elements we're tracking in order to handle
 * the next file
 */
private void reset() {
 elements.clear();
 for(ImageElement e : elementsToTrack) 
  elements.put(e, null);
 
 fileSize = 0l;
}

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

@Override
void visit(ImageElement element, String value) throws IOException {
 // Explicitly label the root path
 if(element == ImageElement.INODE_PATH && value.equals(""))
  value = "/";
 
 // Special case of file size, which is sum of the num bytes in each block
 if(element == ImageElement.NUM_BYTES)
  fileSize += Long.parseLong(value);
 
 if(elements.containsKey(element) && element != ImageElement.NUM_BYTES)
  elements.put(element, value);
 
}

代码示例来源:origin: org.apache.hadoop/hadoop-hdfs

@Override
void visitEnclosingElement(ImageElement element, ImageElement key,
  String value) throws IOException {
 // Special case as numBlocks is an attribute of the blocks element
 if(key == ImageElement.NUM_BLOCKS 
   && elements.containsKey(ImageElement.NUM_BLOCKS))
  elements.put(key, value);
 
 elemQ.push(element);
}

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

/**
 * {@inheritDoc}
 *
 * <p>This implementation iterates through {@code map}'s entry set, calling
 * {@code put()} for each.
 */
public void putAll(Map<? extends K, ? extends V> map) {
  for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
    put(entry.getKey(), entry.getValue());
  }
}

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

/**
 * {@inheritDoc}
 *
 * <p>This implementation iterates through {@code map}'s entry set, calling
 * {@code put()} for each.
 */
public void putAll(Map<? extends K, ? extends V> map) {
  for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
    put(entry.getKey(), entry.getValue());
  }
}

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

/**
 * {@inheritDoc}
 *
 * <p>This implementation iterates through {@code map}'s entry set, calling
 * {@code put()} for each.
 */
public void putAll(Map<? extends K, ? extends V> map) {
  for (Entry<? extends K, ? extends V> entry : map.entrySet()) {
    put(entry.getKey(), entry.getValue());
  }
}

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

/**
 * {@inheritDoc}
 *
 * <p>This implementation iterates through {@code map}'s entry set, calling
 * {@code put()} for each.
 */
public void putAll(Map<? extends K, ? extends V> map) {
  for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
    put(entry.getKey(), entry.getValue());
  }
}

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

/**
 * {@inheritDoc}
 *
 * <p>This implementation iterates through {@code map}'s entry set, calling
 * {@code put()} for each.
 */
public void putAll(Map<? extends K, ? extends V> map) {
  for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
    put(entry.getKey(), entry.getValue());
  }
}

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

/**
 * {@inheritDoc}
 *
 * <p>This implementation iterates through {@code map}'s entry set, calling
 * {@code put()} for each.
 */
public void putAll(Map<? extends K, ? extends V> map) {
  for (Map.Entry<? extends K, ? extends V> entry : map.entrySet()) {
    put(entry.getKey(), entry.getValue());
  }
}

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

MethodInvocation withArg(String name, Object value) {
    this.args.put(name, value);
    return this;
  }
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

/**
 * Reset the values of the elements we're tracking in order to handle
 * the next file
 */
private void reset() {
 elements.clear();
 for(ImageElement e : elementsToTrack) 
  elements.put(e, null);
 
 fileSize = 0l;
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

/**
 * Reset the values of the elements we're tracking in order to handle
 * the next file
 */
private void reset() {
 elements.clear();
 for(ImageElement e : elementsToTrack) 
  elements.put(e, null);
 
 fileSize = 0l;
}

代码示例来源:origin: com.github.stephenc.scale7/scale7-core

private void addNode(SortedMap<Long, T> circle, AbstractMap<String, T> nodeMap, T node, int replicationFactor) {
  for (int i = 0; i < replicationFactor; i++) {
    circle.put(hasher.hash(node.toString() + i), node);
  }
  nodeMap.put(node.toString(), node);
}

代码示例来源:origin: io.prestosql.hadoop/hadoop-apache

@Override
void visitEnclosingElement(ImageElement element, ImageElement key,
  String value) throws IOException {
 // Special case as numBlocks is an attribute of the blocks element
 if(key == ImageElement.NUM_BLOCKS 
   && elements.containsKey(ImageElement.NUM_BLOCKS))
  elements.put(key, value);
 
 elemQ.push(element);
}

代码示例来源:origin: ConsenSys/eventeum

/**
 * {@inheritDoc}
 */
@Override
public void updateLatestBlock(String eventSpecHash, BigInteger blockNumber) {
  final BigInteger currentLatest = latestBlocks.get(eventSpecHash);
  if (currentLatest == null || blockNumber.compareTo(currentLatest) > 0) {
    latestBlocks.put(eventSpecHash, blockNumber);
  }
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

@Override
void visit(ImageElement element, String value) throws IOException {
 // Explicitly label the root path
 if(element == ImageElement.INODE_PATH && value.equals(""))
  value = "/";
 
 // Special case of file size, which is sum of the num bytes in each block
 if(element == ImageElement.NUM_BYTES)
  fileSize += Long.parseLong(value);
 
 if(elements.containsKey(element) && element != ImageElement.NUM_BYTES)
  elements.put(element, value);
 
}

代码示例来源:origin: com.facebook.hadoop/hadoop-core

@Override
void visitEnclosingElement(ImageElement element, ImageElement key,
  String value) throws IOException {
 // Special case as numBlocks is an attribute of the blocks element
 if(key == ImageElement.NUM_BLOCKS 
   && elements.containsKey(ImageElement.NUM_BLOCKS))
  elements.put(key, value);
 
 elemQ.push(element);
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

/**
 * Reset the values of the elements we're tracking in order to handle
 * the next file
 */
private void reset() {
 elements.clear();
 for(ImageElement e : elementsToTrack) 
  elements.put(e, null);
 
 fileSize = 0l;
}

代码示例来源:origin: ch.cern.hadoop/hadoop-hdfs

@Override
void visitEnclosingElement(ImageElement element, ImageElement key,
  String value) throws IOException {
 // Special case as numBlocks is an attribute of the blocks element
 if(key == ImageElement.NUM_BLOCKS 
   && elements.containsKey(ImageElement.NUM_BLOCKS))
  elements.put(key, value);
 
 elemQ.push(element);
}

相关文章