Gets count map.

@param stringCollection the string collection
@return the count map
968099
public static Map<String, Long> getCountMap(
            Collection<String> stringCollection) {
        return unmodifiableMap(countBy(stringCollection));
    }
1332219
public Collection keyCollection() {
        if (keyCollection == null) {
            keyCollection = new AbstractCollectionView() {
                public long size() throws ObjectManagerException {
                    return AbstractTreeMap.this.size();
                }

                public Iterator iterator() throws ObjectManagerException {
                    return makeTreeMapIterator(
                    new AbstractMapEntry.Type() {
                        public Object get(AbstractMapEntry entry) {
                            return entry.key;
                        }
                    });
                }
            };
        }
        return keyCollection;
    }
800654
@SuppressWarnings("unchecked")
  public final <T> Map<String, T> get(final Collection<String> keyCollections, final long timeout)
      throws TimeoutException, InterruptedException, MemcachedException {
    return this.get(keyCollections, timeout, this.transcoder);
  }
322726
public Map<String, Collection<String>> toMap() {
        Map<String, Collection<String>> params = new HashMap<String, Collection<String>>();
        if (null != type) {
            ArrayList<String> valueList = new ArrayList<String>();
            valueList.add(type);
            params.put("type", valueList);
        }
        if (null != data) {
            ArrayList<String> valueList = new ArrayList<String>();
            valueList.add(data);
            params.put("data", valueList);
        }

        return params;
    }
995011
public String getPatternForNumItems(int count) {
        if (count <= 0) {
            throw new IllegalArgumentException("count must be > 0");
        }
        ArrayList<String> list = new ArrayList<String>();
        for (int i = 0; i < count; i++) {
            list.add(String.format("{%d}", i));
        }
        return format(list);
    }
502419
public function count($collection)
    {
        $collection = $this->makeCollection($collection);
        $url        = UrlHelper::buildUrl(Urls::URL_COLLECTION, [$collection, self::OPTION_COUNT]);
        $response   = $this->getConnection()->get($url);

        $data  = $response->getJson();
        $count = $data[self::OPTION_COUNT];

        return (int) $count;
    }
4882
public static String determineCollectionFromId(final String id) {
		final int delimiter = id.indexOf(KEY_DELIMITER);
		return delimiter == -1 ? null : id.substring(0, delimiter);
	}
647908
public static List<String> collectionToStringList(Collection c) {
        List<String> l = new ArrayList<String>(c.size());
        for (Object o : c) {
            l.add(o.toString());
        }
        return l;
    }
113274
public Map<String, ActiveMQQueueStats> getQueueStats() {
        Map<String, ActiveMQQueueStats> result;

        result = new TreeMap<>();

        synchronized ( this.queueStats ) {
            for (QueueStatisticsCollection queueStatisticsCollection : this.queueStats.values()) {
                result.put(queueStatisticsCollection.getQueueName(), queueStatisticsCollection.getQueueTotalStats());
            }
        }

        return result;
    }
473738
public static <T> List<String> sortByPinyin(Collection<String> collection) {
		return sort(collection, new PinyinComparator());
	}
149784
private static <E> Counter<Integer> collectCountCounts(Counter<E> counts) {
    Counter<Integer> cc = new ClassicCounter<Integer>(); // counts of counts
    for (Map.Entry<E, Double> entry : counts.entrySet()) {
      //E item = entry.getKey();
      Integer count = (int) Math.round(entry.getValue());
      cc.incrementCount(count);
    }
    return cc;
  }
973914
public static <T, C extends Collection<T>> Map<T, C> makeElementsToContainersMap(
      final Iterable<C> collections) {
    final ImmutableMap.Builder<T, C> ret = ImmutableMap.builder();

    for (final C collection : collections) {
      for (final T item : collection) {
        ret.put(item, collection);
      }
    }

    return ret.build();
  }
552501
private void fillCollection(Collection<?> collection) {

        int count = 0;

        // 展开  Collection 容器, 输出逗号分隔以支持 IN (...) 语法
        // "IN :varlist" --> "IN (?, ?, ...)"
        if (collection.isEmpty()) {

            // 输出  "IN (NULL)" 保证不会产生错误
            builder.append(NULL);

        } else {

            // 输出逗号分隔的参数表
            for (Object value : collection) {

                if (value != null) {

                    if (count > 0) {
                        builder.append(COMMA);
                    }

                    // 输出参数内容
                    addArg(value);

                    builder.append(QUESTION);

                    count++;
                }
            }
        }
    }
713504
public static AssociativeArray frequencies(FlatDataCollection flatDataCollection) {
        AssociativeArray frequencies = new AssociativeArray();
        
        for (Object value : flatDataCollection) {
            Object counter = frequencies.get(value);
            if(counter==null) {
                frequencies.put(value, 1);
            }
            else {
                frequencies.put(value, ((Number)counter).intValue()+1);
            }
        }
        
        return frequencies;
    }
1017606
public static Collection<Object> toCollectionMap(Collection<?> aCollection)
   throws Exception
   {
      if(aCollection == null )
         return null;
         
      List<Object> listMap = new ArrayList<Object>(aCollection.size());  

      Object nestedObj = null;
      for(Iterator<?> i= aCollection.iterator();i.hasNext();)
      {
                
          nestedObj = i.next();
            listMap.add(toNestedMap(nestedObj));
      }
              
      return listMap;
   }
1118015
String getCollectionName(String url) {
        final String SEPARATOR = "\\";
        String cell = null;
        String node = null;
        String serverName = null;
        int index = -1;

        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[GET_COLLECTION_NAME], "url: " + url);
        }

        //lets look to see if we can use the url.  This most likely means the native driver
        if (url != null && url.indexOf("jdbc:db2") != -1) {
            String collection = url;

            index = collection.indexOf(";");
            if (index != -1) {
                collection = collection.substring(0, index);
            }
            index = collection.indexOf("//");
            if (index != -1) {
                collection = collection.substring(index + 2);
            }
            index = collection.indexOf("/");
            if (index != -1) {
                collection = collection.substring(index + 1).trim();
                if (collection.length() != 0) {
                    as400_collection = collection;
                }
            }
        } else {
            //using toolbox driver

            //            try {
            //            	/*
            //                String unformatted = com.ibm.websphere.runtime.ServerName.getFullName();
            //
            //                if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled()&&LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            //                    LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[GET_COLLECTION_NAME], "Full server name retrieved: " + unformatted);
            //                }
            //
            //                //we need everything or nothing, so do no checking here until we're done.
            //                //if we something winds up null, then we're toast anyway, so take the exception
            //                //and use the defaults in the catch below.
            //                index = unformatted.indexOf(SEPARATOR);
            //                cell = unformatted.substring(0, index);
            //                unformatted = unformatted.substring(index + SEPARATOR.length());
            //
            //                index = unformatted.indexOf(SEPARATOR);
            //                node = unformatted.substring(0, index);
            //
            //                serverName = unformatted.substring(index + SEPARATOR.length());
            //
            //                if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled()&&LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
            //                    LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[GET_COLLECTION_NAME], "Using cell name: " + cell);
            //                    LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[GET_COLLECTION_NAME], "Using node name: " + node);
            //                    LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[GET_COLLECTION_NAME], "Using server name: " + serverName);
            //                }
            //
            //                if ((cell == null) || (node == null) || (serverName == null))
            //                    throw new Exception("Unable to retrieve cell, node, or serverName.");
            //
            //                com.ibm.ws.runtime.service.Repository repository = com.ibm.ws.runtime.service.RepositoryFactory.createRepository(System.getProperty("user.install.root") + "/config", cell, node, serverName);
            //
            //                  */
            //                // com.ibm.ws.runtime.service.Repository repository = com.ibm.ws.runtime.service.RepositoryFactory.createRepository(System.getProperty("user.install.root") + "/config", cell, node, serverName);
            //                // PK78174 this instanceof com.ibm.wsspi.runtime.component.WsComponent
            //                Repository repository = (Repository) WsServiceRegistry.getService(this, Repository.class);
            //
            //                if (repository == null)
            //                    throw new Exception("Unable to acquire a reference to the repository.");
            //
            //                String jndiDSName = _smc.getJNDIDataSourceName();
            //                if ((as400_collection = retrieveDBSessionCollection(repository, com.ibm.ws.runtime.service.ConfigRoot.SERVER, jndiDSName)) == null) {
            //                    if ((as400_collection = retrieveDBSessionCollection(repository, com.ibm.ws.runtime.service.ConfigRoot.NODE, jndiDSName)) == null) {
            //                        if ((as400_collection = retrieveDBSessionCollection(repository, com.ibm.ws.runtime.service.ConfigRoot.CELL, jndiDSName)) == null) {
            //                        	if ((as400_collection = retrieveDBSessionCollection(repository, com.ibm.ws.runtime.service.ConfigRoot.CLUSTER, jndiDSName)) == null) {
            //                        		throw new Exception("DataSource not configured with JNDI name: " + jndiDSName);
            //                        	}
            //                        }
            //                    }
            //                }
            //            } catch (Exception ex) {
            //                LoggingUtil.SESSION_LOGGER_WAS.logp(Level.WARNING, methodClassName, methodNames[GET_COLLECTION_NAME], "CommonMessage.exception", ex);
            //            }
        }

        if (as400_collection == null) {
            String installLibrary = System.getProperty("was.install.library");
            if (installLibrary == null) {
                LoggingUtil.SESSION_LOGGER_WAS.logp(Level.WARNING, methodClassName, methodNames[GET_COLLECTION_NAME], "CommonMessage.miscData",
                                                    "was.install.library not set.  Using collection QEJBASSN for session persistance.");
                as400_collection = "QEJBASSN";
            } else {
                LoggingUtil.SESSION_LOGGER_WAS.logp(Level.WARNING, methodClassName, methodNames[GET_COLLECTION_NAME], "CommonMessage.miscData",
                                                    "using was.install.library to derive collection name for session persistance.");
                as400_collection = installLibrary + "SN";
                if (as400_collection.length() > 10) {
                    as400_collection = as400_collection.substring(0, 10);
                }
            }
        }
        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINER)) {
            LoggingUtil.SESSION_LOGGER_WAS.exiting(methodClassName, methodNames[GET_COLLECTION_NAME], "Session Persistance will use the collection: " + as400_collection);
        }
        return as400_collection;
    }
408392
public static String[] toArray(Collection<String> stringCollection) {
        return JMOptional.getOptional(stringCollection).map(Collection::size)
                .map(String[]::new).map(stringCollection::toArray)
                .orElseGet(JMArrays::getEmptyStringArray);
    }