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

x33g5p2x  于2022-01-17 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(167)

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

ConcurrentHashMap.isEmpty介绍

[英]Returns true if this map contains no key-value mappings.
[中]如果此映射不包含键值映射,则返回true。

代码示例

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

/** Returns {@code true} if this map contains no key-value mappings. */
public boolean isEmpty() {
 return map.isEmpty();
}

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

@Override
public boolean isEmpty() {
  return delegateMap.isEmpty();
}

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

@Override
public boolean isEmpty() {
  return delegateMap.isEmpty();
}

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

/** Returns {@code true} if this map contains no key-value mappings. */
public boolean isEmpty() {
 return map.isEmpty();
}

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

/** Returns {@code true} if this map contains no key-value mappings. */
public boolean isEmpty() {
 return map.isEmpty();
}

代码示例来源:origin: sohutv/cachecloud

/**
 * Returns {@code true} if this map contains no key-value mappings.
 */
public boolean isEmpty() {
  return map.isEmpty();
}

代码示例来源:origin: sohutv/cachecloud

/**
 * Returns {@code true} if this map contains no key-value mappings.
 */
public boolean isEmpty() {
  return map.isEmpty();
}

代码示例来源:origin: ben-manes/caffeine

@Override
public boolean isEmpty() {
 return data.isEmpty();
}

代码示例来源:origin: ben-manes/caffeine

@Override
public boolean isEmpty() {
 return data.isEmpty();
}

代码示例来源:origin: com.h2database/h2

/**
 * Return whether is this schema is empty (does not contain any objects).
 *
 * @return {@code true} if this schema is empty, {@code false} otherwise
 */
public boolean isEmpty() {
  return tablesAndViews.isEmpty() && synonyms.isEmpty() && indexes.isEmpty() && sequences.isEmpty()
      && triggers.isEmpty() && constraints.isEmpty() && constants.isEmpty() && functions.isEmpty();
}

代码示例来源:origin: hibernate/hibernate-orm

/**
 * Does this registry currently contain registrations?
 *
 * @return true/false
 */
public boolean hasRegistrations() {
  return !sessionFactoryMap.isEmpty();
}

代码示例来源:origin: Alluxio/alluxio

@Override
public boolean isEmpty() {
 return mMap.isEmpty();
}

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

boolean isEmpty() {
  readLock.lock();
  try {
    return messageIdPartitionMap.isEmpty();
  } finally {
    readLock.unlock();
  }
}

代码示例来源:origin: sohutv/cachecloud

private Map<K, Long> createAsMap() {
  Map<K,Long> resultMap = new LinkedHashMap<K, Long>();
  if(map != null && !map.isEmpty()){
    for(Entry<K, AtomicLong> entry : map.entrySet()){
      resultMap.put(entry.getKey(), entry.getValue().get());
    }
  }
  return Collections.unmodifiableMap(resultMap);
}

代码示例来源:origin: sohutv/cachecloud

private Map<K, Long> createAsMap() {
  Map<K,Long> resultMap = new LinkedHashMap<K, Long>();
  if(map != null && !map.isEmpty()){
    for(Entry<K, AtomicLong> entry : map.entrySet()){
      resultMap.put(entry.getKey(), entry.getValue().get());
    }
  }
  return Collections.unmodifiableMap(resultMap);
}

代码示例来源:origin: spring-projects/spring-security-oauth

public int getAccessTokenCount() {
  Assert.state(accessTokenStore.isEmpty() || accessTokenStore.size() >= accessTokenToRefreshTokenStore.size(),
      "Too many refresh tokens");
  Assert.state(accessTokenStore.size() == authenticationToAccessTokenStore.size(),
      "Inconsistent token store state");
  Assert.state(accessTokenStore.size() <= authenticationStore.size(), "Inconsistent authentication store state");
  return accessTokenStore.size();
}

代码示例来源:origin: spring-projects/spring-framework

protected boolean isEmpty(Cache cache) {
  ConcurrentHashMap<?, ?> nativeCache = (ConcurrentHashMap<?, ?>) cache.getNativeCache();
  return nativeCache.isEmpty();
}

代码示例来源:origin: spring-projects/spring-framework

@Override
@CacheRemoveAll(afterInvocation = false)
public void earlyRemoveAll() {
  ConcurrentHashMap<?, ?> nativeCache = (ConcurrentHashMap<?, ?>) defaultCache.getNativeCache();
  if (!nativeCache.isEmpty()) {
    throw new AssertionError("Cache was expected to be empty");
  }
}

代码示例来源:origin: spring-projects/spring-framework

@Override
@CacheRemoveAll(afterInvocation = false)
public void earlyRemoveAll() {
  ConcurrentHashMap<?, ?> nativeCache = (ConcurrentHashMap<?, ?>) defaultCache.getNativeCache();
  if (!nativeCache.isEmpty()) {
    throw new AssertionError("Cache was expected to be empty");
  }
}

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

void tryFinish() {
 if (workerThreads.isEmpty()) {
  this.getSourceMetrics().clear();
  manager.finishRecoveredSource(this);
 }
}

相关文章