com.google.common.collect.Multimap.clear()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(135)

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

Multimap.clear介绍

[英]Removes all key-value pairs from the multimap, leaving it #isEmpty.
[中]从多重映射中删除所有键值对,使其为空。

代码示例

代码示例来源:origin: google/guava

@Override
 public void clear() {
  multimap.clear();
 }
}

代码示例来源:origin: google/guava

@Override
public void clear() {
 fromMultimap.clear();
}

代码示例来源:origin: google/guava

@Override
public void clear() {
 multimap.clear();
}

代码示例来源:origin: google/j2objc

@Override
 public void clear() {
  multimap.clear();
 }
}

代码示例来源:origin: google/j2objc

@Override
 public void clear() {
  multimap().clear();
 }
}

代码示例来源:origin: google/j2objc

@Override
public void clear() {
 fromMultimap.clear();
}

代码示例来源:origin: google/error-prone

@Override
public Description matchCompilationUnit(CompilationUnitTree tree, VisitorState state) {
 /*
  * Clear the collections to save memory. (I wonder if it also helps to handle weird cases when a
  * class has multiple definitions. But I would expect for multiple definitions within the same
  * compiler invocation to cause deeper problems.)
  */
 paramTypesForMethod.clear();
 callersToEvaluate.clear(); // should have already been cleared
 return NO_MATCH;
}

代码示例来源:origin: google/guava

@Override
 public void clear() {
  multimap().clear();
 }
}

代码示例来源:origin: google/guava

@Override
public void clear() {
 synchronized (mutex) {
  delegate().clear();
 }
}

代码示例来源:origin: google/guava

@Override
public void clear() {
 delegate().clear();
}

代码示例来源:origin: apache/incubator-shardingsphere

/**
 * Add sharding value for database sharding only.
 *
 * <p>The sharding operator is {@code =}</p>
 * When you only need to sharding database, use this method to add database sharding value.
 *
 * @param value sharding value
 */
public void setDatabaseShardingValue(final Comparable<?> value) {
  databaseShardingValues.clear();
  addDatabaseShardingValue(HintManagerHolder.DB_TABLE_NAME, value);
  databaseShardingOnly = true;
}

代码示例来源:origin: google/j2objc

@Override
public void clear() {
 synchronized (mutex) {
  delegate().clear();
 }
}

代码示例来源:origin: google/j2objc

@Override
public void clear() {
 delegate().clear();
}

代码示例来源:origin: google/guava

@MapFeature.Require(SUPPORTS_REMOVE)
public void testClearPropagatesToAsMap() {
 Map<K, Collection<V>> asMap = multimap().asMap();
 multimap().clear();
 assertEmpty(asMap);
}

代码示例来源:origin: google/guava

@MapFeature.Require(SUPPORTS_REMOVE)
 public void testClearPropagatesToEntries() {
  Collection<Entry<K, V>> entries = multimap().entries();
  multimap().clear();
  assertEmpty(entries);
 }
}

代码示例来源:origin: google/guava

@MapFeature.Require(SUPPORTS_REMOVE)
public void testClear() {
 multimap().clear();
 assertCleared();
}

代码示例来源:origin: google/guava

@MapFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = ZERO)
public void testClearPropagatesToAsMapGet() {
 for (K key : sampleKeys()) {
  resetContainer();
  Collection<V> collection = multimap().asMap().get(key);
  if (collection != null) {
   multimap().clear();
   assertEmpty(collection);
  }
 }
}

代码示例来源:origin: google/guava

@CollectionSize.Require(absent = ZERO)
@MapFeature.Require(absent = SUPPORTS_REMOVE)
public void testClearUnsupported() {
 try {
  multimap().clear();
  fail("Expected UnsupportedOperationException");
 } catch (UnsupportedOperationException expected) {
 }
}

代码示例来源:origin: google/guava

@MapFeature.Require(SUPPORTS_REMOVE)
@CollectionSize.Require(absent = ZERO)
public void testClearPropagatesToGet() {
 for (K key : sampleKeys()) {
  resetContainer();
  Collection<V> collection = multimap().get(key);
  multimap().clear();
  assertEmpty(collection);
 }
}

代码示例来源:origin: prestodb/presto

public synchronized void clearSplits()
{
  splits.clear();
  partitionedSplitCountTracker.setPartitionedSplitCount(getPartitionedSplitCount());
  runningDrivers = 0;
  updateSplitQueueSpace();
}

相关文章