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

x33g5p2x  于2022-01-29 转载在 其他  
字(3.5k)|赞(0)|评价(0)|浏览(386)

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

Table.clear介绍

[英]Removes all mappings from the table.
[中]从表中删除所有映射。

代码示例

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

  1. @Override
  2. public void clear() {
  3. original.clear();
  4. }

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

  1. @Override
  2. public void clear() {
  3. fromTable.clear();
  4. }

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

  1. @Override
  2. public void clear() {
  3. fromTable.clear();
  4. }

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

  1. @Override
  2. public void clear() {
  3. synchronized (mutex) {
  4. delegate().clear();
  5. }
  6. }

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

  1. @Override
  2. public void clear() {
  3. original.clear();
  4. }

代码示例来源:origin: MovingBlocks/Terasology

  1. /**
  2. * Clears all registered population densities
  3. */
  4. protected void clearProbabilities() {
  5. probsTable.clear();
  6. }

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

  1. @Override
  2. public void clear() {
  3. synchronized (mutex) {
  4. delegate().clear();
  5. }
  6. }

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

  1. @Override
  2. public void clear() {
  3. delegate().clear();
  4. }

代码示例来源:origin: apache/storm

  1. @Override
  2. public void prepare(Map<String, Object> topoConf, Object registrationArgument, TopologyContext context, IErrorReporter errorReporter) {
  3. synchronized (BUFFER) {
  4. BUFFER.clear();
  5. }
  6. }

代码示例来源:origin: apache/storm

  1. @Override
  2. public void cleanup() {
  3. synchronized (BUFFER) {
  4. BUFFER.clear();
  5. }
  6. }

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

  1. @Override
  2. public void clear() {
  3. delegate().clear();
  4. }

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

  1. @Override
  2. public void clear() {
  3. assertTrue(Thread.holdsLock(mutex));
  4. delegate.clear();
  5. }

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

  1. @Override
  2. public void clear() {
  3. synchronized (mutex) {
  4. delegate().clear();
  5. }
  6. }

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

  1. @Override
  2. protected Table<String, Integer, Character> create(Object... data) {
  3. Table<String, Integer, Character> table = HashBasedTable.create();
  4. table.put("foo", 4, 'a');
  5. table.put("cat", 1, 'b');
  6. table.clear();
  7. populate(table, data);
  8. return table;
  9. }

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

  1. @Override
  2. protected Collection<String> create(String[] elements) {
  3. Table<Integer, Character, String> table = HashBasedTable.create();
  4. table.put(1, 'a', "foo");
  5. table.clear();
  6. populateForValues(table, elements);
  7. return table.values();
  8. }
  9. })

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

  1. @Override
  2. protected Collection<String> create(String[] elements) {
  3. Table<Integer, Character, String> table = TreeBasedTable.create();
  4. table.put(1, 'a', "foo");
  5. table.clear();
  6. populateForValues(table, elements);
  7. return table.values();
  8. }
  9. })

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

  1. public final void testClear() {
  2. for (Table<Character, Integer, String> testInstance : getTestInstances()) {
  3. try {
  4. testInstance.clear();
  5. fail();
  6. } catch (UnsupportedOperationException e) {
  7. // success
  8. }
  9. }
  10. }

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

  1. @Override
  2. protected Collection<String> create(String[] elements) {
  3. Table<Integer, Character, String> table = HashBasedTable.create();
  4. table.put(1, 'a', "foo");
  5. table.clear();
  6. populateForValues(table, elements);
  7. return Tables.unmodifiableTable(table).values();
  8. }
  9. })

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

  1. @Override
  2. protected Table<String, Integer, Character> create(Object... data) {
  3. Table<Integer, String, Character> original = HashBasedTable.create();
  4. Table<String, Integer, Character> table = Tables.transpose(original);
  5. table.clear();
  6. populate(table, data);
  7. return table;
  8. }

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

  1. public void testClear() {
  2. table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
  3. if (supportsRemove()) {
  4. table.clear();
  5. assertEquals(0, table.size());
  6. assertFalse(table.containsRow("foo"));
  7. } else {
  8. try {
  9. table.clear();
  10. fail();
  11. } catch (UnsupportedOperationException expected) {
  12. }
  13. }
  14. }

相关文章