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

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

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

Table.isEmpty介绍

[英]Returns true if the table contains no mappings.
[中]

代码示例

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

  1. @Override
  2. public boolean isEmpty() {
  3. synchronized (mutex) {
  4. return delegate().isEmpty();
  5. }
  6. }

代码示例来源:origin: deeplearning4j/nd4j

  1. @Override
  2. public synchronized boolean isEmpty() {
  3. return wrapped.isEmpty();
  4. }

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

  1. @Override
  2. public boolean isEmpty() {
  3. synchronized (mutex) {
  4. return delegate().isEmpty();
  5. }
  6. }

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

  1. @Override
  2. public boolean isEmpty() {
  3. return delegate().isEmpty();
  4. }

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

  1. @Override
  2. public boolean isEmpty() {
  3. return delegate().isEmpty();
  4. }

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

  1. @Override
  2. public boolean isEmpty() {
  3. assertTrue(Thread.holdsLock(mutex));
  4. return delegate.isEmpty();
  5. }

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

  1. @Override
  2. public boolean isEmpty() {
  3. synchronized (mutex) {
  4. return delegate().isEmpty();
  5. }
  6. }

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

  1. @Override
  2. public boolean isEmpty() {
  3. return delegate().isEmpty();
  4. }

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

  1. @Override
  2. public void testIsEmpty() {
  3. assertFalse(table.isEmpty());
  4. table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
  5. assertFalse(table.isEmpty());
  6. }

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

  1. public void testIsEmpty() {
  2. assertTrue(table.isEmpty());
  3. table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
  4. assertFalse(table.isEmpty());
  5. }

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

  1. @Override
  2. <R extends Comparable<R>, C extends Comparable<C>, V> Table<R, C, V> create(
  3. Table<R, C, V> contents) {
  4. if (contents.isEmpty()) {
  5. return ImmutableTable.of();
  6. } else {
  7. return ArrayTable.create(contents);
  8. }
  9. }
  10. },

代码示例来源:origin: EngineHub/WorldEdit

  1. private void populate(Map<Map<Property<?>, Object>, BlockState> stateMap) {
  2. final Table<Property<?>, Object, BlockState> states = HashBasedTable.create();
  3. for(final Map.Entry<Property<?>, Object> entry : this.values.entrySet()) {
  4. final Property<Object> property = (Property<Object>) entry.getKey();
  5. property.getValues().forEach(value -> {
  6. if(value != entry.getValue()) {
  7. BlockState modifiedState = stateMap.get(this.withValue(property, value));
  8. if (modifiedState != null) {
  9. states.put(property, value, modifiedState);
  10. } else {
  11. System.out.println(stateMap);
  12. WorldEdit.logger.warning("Found a null state at " + this.withValue(property, value));
  13. }
  14. }
  15. });
  16. }
  17. this.states = states.isEmpty() ? states : ArrayTable.create(states);
  18. }

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

  1. /** Fails if the table is not empty. */
  2. public void isEmpty() {
  3. if (!actual().isEmpty()) {
  4. failWithActual(simpleFact("expected to be empty"));
  5. }
  6. }

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

  1. /** Fails if the table is empty. */
  2. public void isNotEmpty() {
  3. if (actual().isEmpty()) {
  4. failWithoutActual(simpleFact("expected not to be empty"));
  5. }
  6. }

代码示例来源:origin: com.fasterxml.jackson.datatype/jackson-datatype-guava

  1. @Override
  2. public boolean isEmpty(SerializerProvider provider, Table<?, ?, ?> table) {
  3. return table.isEmpty();
  4. }

代码示例来源:origin: com.fasterxml.jackson.datatype/jackson-datatype-guava

  1. @Override
  2. public void serialize(final Table<?, ?, ?> value,
  3. final JsonGenerator gen, final SerializerProvider provider)
  4. throws IOException
  5. {
  6. gen.writeStartObject(value);
  7. if ( !value.isEmpty()) {
  8. serializeFields(value, gen, provider);
  9. }
  10. gen.writeEndObject();
  11. }

代码示例来源:origin: org.sonatype.sisu/sisu-guava

  1. @Override public boolean equals(@Nullable Object obj) {
  2. if (obj == this) {
  3. return true;
  4. } else if (obj instanceof Table<?, ?, ?>) {
  5. Table<?, ?, ?> that = (Table<?, ?, ?>) obj;
  6. return that.isEmpty();
  7. } else {
  8. return false;
  9. }
  10. }

代码示例来源:origin: com.google.javascript/closure-compiler

  1. private void rewriteJsdoc(NodeTraversal t, JSDocInfo info, ModuleMetadata currentModule) {
  2. if (typesToInline.isEmpty() && nonAliasedNamespaces.isEmpty()) {
  3. return;
  4. }
  5. JsDocRefReplacer replacer = new JsDocRefReplacer(currentModule, t.getScope());
  6. for (Node typeNode : info.getTypeNodes()) {
  7. NodeUtil.visitPreOrder(typeNode, replacer);
  8. }
  9. }

代码示例来源:origin: com.google.guava/guava-tests

  1. @Override public void testIsEmpty() {
  2. assertFalse(table.isEmpty());
  3. table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c');
  4. assertFalse(table.isEmpty());
  5. }

代码示例来源:origin: com.google.javascript/closure-compiler

  1. void rewrite(Node scriptNode) {
  2. transpiled = false;
  3. renameTable = HashBasedTable.create();
  4. NodeTraversal.traverse(compiler, scriptNode, this);
  5. if (transpiled) {
  6. scriptNode.putBooleanProp(Node.TRANSPILED, true);
  7. }
  8. if (!renameTable.isEmpty()) {
  9. NodeTraversal.traverse(
  10. compiler, scriptNode, new Es6RenameReferences(renameTable, /* typesOnly= */ true));
  11. }
  12. }

相关文章