当前位置: 首页>>代码示例>>Java>>正文


Java ImmutableCollection.size方法代码示例

本文整理汇总了Java中com.google.common.collect.ImmutableCollection.size方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutableCollection.size方法的具体用法?Java ImmutableCollection.size怎么用?Java ImmutableCollection.size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.collect.ImmutableCollection的用法示例。


在下文中一共展示了ImmutableCollection.size方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clearNodes

import com.google.common.collect.ImmutableCollection; //导入方法依赖的package包/类
/**
 * Clear all of the holders permission nodes
 */
public boolean clearNodes() {
    ImmutableCollection<Node> before = getEnduringNodes().values();

    this.nodesLock.lock();
    try {
        this.nodes.clear();
    } finally {
        this.nodesLock.unlock();
    }

    invalidateCache();
    ImmutableCollection<Node> after = getEnduringNodes().values();

    if (before.size() == after.size()) {
        return false;
    }

    this.plugin.getEventFactory().handleNodeClear(this, before, after);
    return true;
}
 
开发者ID:lucko,项目名称:LuckPerms,代码行数:24,代码来源:PermissionHolder.java

示例2: clearTransientNodes

import com.google.common.collect.ImmutableCollection; //导入方法依赖的package包/类
public boolean clearTransientNodes() {
    ImmutableCollection<Node> before = getTransientNodes().values();

    this.transientNodesLock.lock();
    try {
        this.transientNodes.clear();
    } finally {
        this.transientNodesLock.unlock();
    }

    invalidateCache();
    ImmutableCollection<Node> after = getTransientNodes().values();

    if (before.size() == after.size()) {
        return false;
    }

    this.plugin.getEventFactory().handleNodeClear(this, before, after);
    return true;
}
 
开发者ID:lucko,项目名称:LuckPerms,代码行数:21,代码来源:PermissionHolder.java

示例3: RunningState

import com.google.common.collect.ImmutableCollection; //导入方法依赖的package包/类
RunningState(
    ImmutableCollection<? extends ListenableFuture<? extends InputT>> futures,
    boolean allMustSucceed,
    boolean collectsValues) {
  super(futures.size());
  this.futures = checkNotNull(futures);
  this.allMustSucceed = allMustSucceed;
  this.collectsValues = collectsValues;
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:10,代码来源:AggregateFuture.java

示例4: CollectionFutureRunningState

import com.google.common.collect.ImmutableCollection; //导入方法依赖的package包/类
CollectionFutureRunningState(
    ImmutableCollection<? extends ListenableFuture<? extends V>> futures,
    boolean allMustSucceed) {
  super(futures, allMustSucceed, true);

  this.values =
      futures.isEmpty()
          ? ImmutableList.<Optional<V>>of()
          : Lists.<Optional<V>>newArrayListWithCapacity(futures.size());

  // Populate the results list with null initially.
  for (int i = 0; i < futures.size(); ++i) {
    values.add(null);
  }
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:16,代码来源:CollectionFuture.java

示例5: CollectionFutureRunningState

import com.google.common.collect.ImmutableCollection; //导入方法依赖的package包/类
CollectionFutureRunningState(
  ImmutableCollection<? extends ListenableFuture<? extends V>> futures,
  boolean allMustSucceed) {
  super(futures, allMustSucceed, true);
  this.values =
    futures.isEmpty()
      ? ImmutableList.<Optional<V>>of()
      : Lists.<Optional<V>>newArrayListWithCapacity(futures.size());

  // Populate the results list with null initially.
  for (int i = 0; i < futures.size(); ++i) {
    values.add(null);
  }
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:15,代码来源:CollectionFuture.java

示例6: CollectionFutureRunningState

import com.google.common.collect.ImmutableCollection; //导入方法依赖的package包/类
CollectionFutureRunningState(
  ImmutableCollection<? extends ListenableFuture<? extends V>> futures,
  boolean allMustSucceed) {
  super(futures, allMustSucceed, true);
  this.values = futures.isEmpty()
    ? ImmutableList.<Optional<V>>of()
    : Lists.<Optional<V>>newArrayListWithCapacity(futures.size());

  // Populate the results list with null initially.
  for (int i = 0; i < futures.size(); ++i) {
    values.add(null);
  }
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:14,代码来源:CollectionFuture.java

示例7: findDirectDispatchTarget

import com.google.common.collect.ImmutableCollection; //导入方法依赖的package包/类
private static Optional<Node> findDirectDispatchTarget(String selfHostname,
                                                       int searchClusterSize,
                                                       int containerClusterSize,
                                                       ImmutableMultimap<String, Node>nodesByHost,
                                                       ImmutableMap<Integer, Group> groups) {
    // A search node in the search cluster in question is configured on the same host as the currently running container.
    // It has all the data <==> No other nodes in the search cluster have the same group id as this node.
    //         That local search node responds.
    // The search cluster to be searched has at least as many nodes as the container cluster we're running in.
    ImmutableCollection<Node> localSearchNodes = nodesByHost.get(selfHostname);
    // Only use direct dispatch if we have exactly 1 search node on the same machine:
    if (localSearchNodes.size() != 1) return Optional.empty();

    SearchCluster.Node localSearchNode = localSearchNodes.iterator().next();
    SearchCluster.Group localSearchGroup = groups.get(localSearchNode.group());

    // Only use direct dispatch if the local search node has the entire corpus
    if (localSearchGroup.nodes().size() != 1) return Optional.empty();

    // Only use direct dispatch if this container cluster has at least as many nodes as the search cluster
    // to avoid load skew/preserve fanout in the case where a subset of the search nodes are also containers.
    // This disregards the case where the search and container clusters are partially overlapping.
    // Such configurations produce skewed load in any case.
    if (containerClusterSize < searchClusterSize) return Optional.empty();

    return Optional.of(localSearchNode);
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:28,代码来源:SearchCluster.java

示例8: RunningState

import com.google.common.collect.ImmutableCollection; //导入方法依赖的package包/类
RunningState(ImmutableCollection<? extends ListenableFuture<? extends InputT>> futures, boolean allMustSucceed, boolean collectsValues) {
  super(futures.size());
  this.futures = checkNotNull(futures);
  this.allMustSucceed = allMustSucceed;
  this.collectsValues = collectsValues;
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:7,代码来源:AggregateFuture.java

示例9: ServiceManagerState

import com.google.common.collect.ImmutableCollection; //导入方法依赖的package包/类
/**
 * It is implicitly assumed that all the services are NEW and that they will all remain NEW
 * until all the Listeners are installed and {@link #markReady()} is called. It is our caller's
 * responsibility to only call {@link #markReady()} if all services were new at the time this
 * method was called and when all the listeners were installed.
 */
ServiceManagerState(ImmutableCollection<Service> services) {
  this.numberOfServices = services.size();
  servicesByState.putAll(NEW, services);
}
 
开发者ID:zugzug90,项目名称:guava-mock,代码行数:11,代码来源:ServiceManager.java

示例10: ServiceManagerState

import com.google.common.collect.ImmutableCollection; //导入方法依赖的package包/类
/**
 * It is implicitly assumed that all the services are NEW and that they will all remain NEW
 * until all the Listeners are installed and {@link #markReady()} is called. It is our caller's
 * responsibility to only call {@link #markReady()} if all services were new at the time this
 * method was called and when all the listeners were installed.
 */

ServiceManagerState(ImmutableCollection<Service> services) {
  this.numberOfServices = services.size();
  servicesByState.putAll(NEW, services);
}
 
开发者ID:antlr,项目名称:codebuff,代码行数:12,代码来源:ServiceManager.java


注:本文中的com.google.common.collect.ImmutableCollection.size方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。