當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。