Cal stats number.

@param statsString       the stats string
@param summaryStatistics the summary statistics
@return the number
184762
public static Number calStats(String statsString,
            LongSummaryStatistics summaryStatistics) {
        return StatsField.valueOfAlias(statsString).calStats(summaryStatistics);
    }
279501
public String getStatistics() {
        StringBuilder sb = new StringBuilder();
        
        for(String key : stats.keySet()) {
            sb.append(key);
            sb.append(": ");
            sb.append(stats.get(key));
            sb.append("\n");
        }
        
        return sb.toString();
    }
677471
@Override
  public MtasDataItemNumberComparator<Double> getCompareValue1() {
    switch (sortType) {
    case CodecUtil.STATS_TYPE_SUM:
      return new MtasDataItemNumberComparator<Double>(valueSum, sortDirection);
    default:
      return null;
    }
  }
475460
private static String getStatisticsName(Method m)
   {
      StringBuilder sb = new StringBuilder();
      sb.append(m.getName());
      sb.append('(');
      Class<?>[] types = m.getParameterTypes();
      if (types != null)
      {
         boolean first = true;
         for (Class<?> type : types)
         {
            if (first)
            {
               first = false;
            }
            else
            {
               sb.append(", ");
            }
            sb.append(type.getSimpleName());
         }
      }
      sb.append(')');
      return sb.toString();
   }
469978
public static DoubleSummary of(final DoubleSummaryStatistics statistics) {
		return new DoubleSummary(
			statistics.getCount(),
			statistics.getMin(),
			statistics.getMax(),
			statistics.getSum(),
			statistics.getAverage()
		);
	}
1101210
private void addStringStatistics(long valueCount, StringStatistics value)
    {
        requireNonNull(value, "value is null");
        checkArgument(valueCount > 0, "valueCount is 0");
        checkArgument(value.getMin() != null || value.getMax() != null, "min and max cannot both be null");

        if (nonNullValueCount == 0) {
            checkState(minimum == null && maximum == null);
            minimum = value.getMin();
            maximum = value.getMax();
        }
        else {
            if (minimum != null && (value.getMin() == null || minimum.compareTo(value.getMin()) > 0)) {
                minimum = value.getMin();
            }
            if (maximum != null && (value.getMax() == null || maximum.compareTo(value.getMax()) < 0)) {
                maximum = value.getMax();
            }
        }

        nonNullValueCount += valueCount;
        sum = addExact(sum, value.getSum());
    }
78877
public static synchronized 
  Statistics getStatistics(String scheme, Class<? extends FileSystem> cls) {
    Statistics result = statisticsTable.get(cls);
    if (result == null) {
      result = new Statistics(scheme);
      statisticsTable.put(cls, result);
    }
    return result;
  }
246576
@Override
  public MtasDataItemNumberComparator<Long> getCompareValue1() {
    switch (sortType) {
    case CodecUtil.STATS_TYPE_N:
      return new MtasDataItemNumberComparator<Long>(valueN, sortDirection);
    case CodecUtil.STATS_TYPE_SUM:
      return new MtasDataItemNumberComparator<Long>(valueSum, sortDirection);
    default:
      return null;
    }
  }
670043
public void statistics(CharSequence message, Throwable e) {
    log(Level.STATISTICS, message, e);
  }
677799
public static <T extends Number> ImmutableNumberStatistics<T> copyOf(NumberStatistics<? extends T> statistics){
		return new ImmutableNumberStatistics<T>(statistics);
	}
627764
public MtasDataItemNumberComparator<Double> getCompareValue2() {
    switch (sortType) {
    case CodecUtil.STATS_TYPE_MEAN:
      return new MtasDataItemNumberComparator<Double>(getValue(sortType),
          sortDirection);
    default:
      return null;
    }
  }
135455
public Optional<CacheStatistics> getStatistics(String cacheName) {

        javax.cache.Cache cache = cacheManager.getCache(cacheName);

        if (cache == null) {
            return Optional.empty();
        }

        if (((CompleteConfiguration) cache.getConfiguration(CompleteConfiguration.class)).isStatisticsEnabled() && cache instanceof ICache) {
            com.hazelcast.cache.CacheStatistics stats = ((ICache) cache).getLocalCacheStatistics();
            CacheStatistics statistics = new CacheStatistics(
                    stats.getCacheHits(),
                    stats.getCacheMisses(),
                    stats.getCacheHitPercentage(),
                    stats.getCacheMissPercentage(),
                    stats.getCacheGets(),
                    stats.getCachePuts(),
                    stats.getCacheRemovals(),
                    stats.getCacheEvictions(),
                    stats.getAverageGetTime(),
                    stats.getAveragePutTime(),
                    stats.getAverageRemoveTime());

            return Optional.of(statistics);
        }

        return Optional.empty();
    }
798565
public void statisticCreated(SPIStatistic s) {
        final String methodName = "statisticCreated()";
        // if (tc.isEntryEnabled()) {
        // Tr.entry(tc, methodName + " cacheName=" + _sCacheName + " statistic=" + s, this);
        // }
        switch (s.getId()) {
        case WSDynamicCacheStats.MaxInMemoryCacheEntryCount:
            _maxInMemoryCacheEntryCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.InMemoryCacheEntryCount:
            _inMemoryCacheEntryCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.HitsInMemoryCount:
            _hitsInMemoryCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.HitsOnDiskCount:
            _hitsOnDiskCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.ExplicitInvalidationCount:
            _explicitInvalidationCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.LruInvalidationCount:
            _lruInvalidationCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.TimeoutInvalidationCount:
            _timeoutInvalidationCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.InMemoryAndDiskCacheEntryCount:
            _inMemoryAndDiskCacheEntryCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.RemoteHitCount:
            _remoteHitCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.MissCount:
            _missCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.ClientRequestCount:
            _clientRequestCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.DistributedRequestCount:
            _distributedRequestCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.ExplicitMemoryInvalidationCount:
            _explicitMemoryInvalidationCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.ExplicitDiskInvalidationCount:
            _explicitDiskInvalidationCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.LocalExplicitInvalidationCount:
            _localExplicitInvalidationCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.RemoteExplicitInvalidationCount:
            _remoteExplicitInvalidationCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.RemoteCreationCount:
            _remoteCreationCount = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.ObjectsOnDisk:
            _objectsOnDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.HitsOnDisk:
            _hitsOnDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.ExplicitInvalidationsFromDisk:
            _explicitInvalidationsFromDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.TimeoutInvalidationsFromDisk:
            _timeoutInvalidationsFromDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.PendingRemovalFromDisk:
            _pendingRemovalFromDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.DependencyIdsOnDisk:
            _dependencyIdsOnDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.DependencyIdsBufferedForDisk:
            _dependencyIdsBufferedForDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.DependencyIdsOffloadedToDisk:
            _dependencyIdsOffloadedToDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.DependencyIdBasedInvalidationsFromDisk:
            _dependencyIdBasedInvalidationsFromDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.TemplatesOnDisk:
            _templatesOnDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.TemplatesBufferedForDisk:
            _templatesBufferedForDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.TemplatesOffloadedToDisk:
            _templatesOffloadedToDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.TemplateBasedInvalidationsFromDisk:
            _templateBasedInvalidationsFromDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.GarbageCollectorInvalidationsFromDisk:
            _garbageCollectorInvalidationsFromDisk = (SPICountStatistic) s;
            break;
        case WSDynamicCacheStats.OverflowInvalidationsFromDisk:
            _overflowInvalidationsFromDisk = (SPICountStatistic) s;
            break;
        default:
            Tr.debug(tc, methodName,
                    "Error - Unknown stats Id for " + WSDynamicCacheStats.NAME + " cacheName=" + _sCacheName + " dataID=" + s.getId());

            assert false;
            break;
        }
    }
763216
private String getStatsString() {
    SplitTypeStats allTypeStats = splitTypeStatsMap.get(SplitType.ALL);
    Map<String, Map<String, Number>> statsMapMap =
      new HashMap<String, Map<String, Number>>();
    for (Map.Entry<SplitType, SplitTypeStats> entry :
        splitTypeStatsMap.entrySet()) {
      Map<String, Number> statsMap = new HashMap<String, Number>();
      statsMapMap.put(entry.getKey().toString(), statsMap);

      float percentTotalSplitCount =
        (100f * entry.getValue().getTotalSplitCount()) /
        allTypeStats.getTotalSplitCount();
      float percentTotalSize =
        (100f * entry.getValue().getTotalSize()) /
        allTypeStats.getTotalSize();
      float percentTotalBlockCount =
          (100f * entry.getValue().getTotalBlockCount()) /
          allTypeStats.getTotalBlockCount();
      float averageSizePerSplit =
          ((float) entry.getValue().getTotalSize()) /
          entry.getValue().getTotalSplitCount();
      float averageHostCountPerSplit =
         ((float) entry.getValue().getTotalHostCount()) /
         entry.getValue().getTotalSplitCount();
      float averageBlockCountPerSplit =
          ((float) entry.getValue().getTotalBlockCount()) /
          entry.getValue().getTotalSplitCount();
      statsMap.put("totalSplitCount", entry.getValue().getTotalSplitCount());
      statsMap.put("percentTotalSplitCount", percentTotalSplitCount);
      statsMap.put("totalSize", entry.getValue().getTotalSize());
      statsMap.put("percentTotalSize", percentTotalSize);
      statsMap.put("averageSizePerSplit", averageSizePerSplit);
      statsMap.put("totalHostCount", entry.getValue().getTotalHostCount());
      statsMap.put("averageHostCountPerSplit", averageHostCountPerSplit);
      statsMap.put("totalBlockCount", entry.getValue().getTotalBlockCount());
      statsMap.put("percentTotalBlockCount", percentTotalBlockCount);
      statsMap.put("averageBlockCountPerSplit", averageBlockCountPerSplit);
    }
    return JSON.toString(statsMapMap);
  }
385755
public String explainScore(StringWrapper s, StringWrapper t) {
	String S = s.unwrap(),
	  T = t.unwrap();
    StringBuffer buff = new StringBuffer();
    buff.append("\n****TagLinkToken****\n");
    buff.append("Si=" + S + ", Tj=" + T + "\n");
    double totalScore = 0.0;
    if (S.equals(T)) {
      matched = S.length();
      buff.append("Sij=1.0");
    }
    else {
      sSize = S.length();
      tSize = T.length();
      // let S be the biggest token
      if (sSize < tSize) {
        String tmp1 = S;
        S = T;
        T = tmp1;
        double tmp2 = sSize;
        sSize = tSize;
        tSize = tmp2;
      }
      ArrayList candidateList = algorithm1(S, T);
      sortList(candidateList);
      buff.append("Common characteres:\n");
      buff.append("Si\tTj\tScore_ij(Si,Tj)\n");
      matched = 0;
      HashMap tMap = new HashMap(),
          uMap = new HashMap();
      java.util.Iterator it = candidateList.iterator();
      while (it.hasNext()) {
        TagLink.Candidates actualCandidates = (TagLink.Candidates) it.next();
        Integer sPos = new Integer(actualCandidates.getTPos()),
            tPos = new Integer(actualCandidates.getUPos());
        if ( (!tMap.containsKey(sPos)) &&
            (!uMap.containsKey(tPos))) {
          double actualScore = actualCandidates.getScore();
          totalScore += actualScore;
          tMap.put(sPos, null);
          uMap.put(tPos, null);
          buff.append(S.charAt(sPos.intValue()) + "\t" + T.charAt(tPos.intValue()) +
                      "\t" + round(actualScore) + "\n");
          matched++;
        }
      }
      totalScore = (totalScore / ( (double) sSize) + totalScore / ( (double) tSize)) / 2.0;
      System.out.println("score " + totalScore);
      buff.append("Score_ij(S,T)=" + round(winkler(totalScore, S, T)));
      buff.append("\nMatched characters=" + matched);
    }
    return buff.toString();
  }
1174765
protected T2 getValue(String statsType) {
    if (statsType.equals(CodecUtil.STATS_TYPE_MEAN)) {
      return operations.divide1(valueSum, valueN);
    } else {
      return null;
    }
  }
830016
public static Number calStats(String statsString, LongStream numberStream) {
        return StatsField.valueOfAlias(statsString).calStats(numberStream);
    }