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


Java SimpleEntry.getValue方法代码示例

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


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

示例1: dumpParameters

import java.util.AbstractMap.SimpleEntry; //导入方法依赖的package包/类
private void dumpParameters() {
    String result;
    for (SimpleEntry<String, Integer> s : parameters) {
        int index = s.getValue();
        savedPoints.replace(index, decompiled.size());
        result = getWhiteSpace() + s.getKey();
        decompiled.add(result);
    }
    parameters.clear();
}
 
开发者ID:thane98,项目名称:3DSFE-Randomizer,代码行数:11,代码来源:EventDecompiler.java

示例2: processConditionals

import java.util.AbstractMap.SimpleEntry; //导入方法依赖的package包/类
private void processConditionals(byte[] input, int currentIndex) {
    if (conditionalLengths.size() > 0 && conditionalIndexes.size() > 0) // If the stack size is 0 we don't need to worry about adding in spaces.
    {
        int currentConditionalLength = conditionalLengths.peek();
        int currentConditionalIndex = conditionalIndexes.peek();
        SimpleEntry<Boolean, Integer> endData = hasEndConditional(input);
        if (endData.getKey() && endData.getValue() == currentIndex) {
            breakNest();
        } else if ((currentConditionalIndex + currentConditionalLength) <= currentIndex) {
            if (currentIndex + 3 < input.length) // Fix for P006.
            {
                if (input[currentIndex] == 0x49 && input[currentIndex + 0x3] == 0x49) {
                    short value = ScriptUtils.shortFromByteArray(input, currentIndex + 1);
                    if (value > 0)
                        omitFlag = true;
                }
            }
            breakNest();
            if (conditionalLengths.size() > 0) // Fix for B027 and B028.
            {
                int nextConditionalLength = conditionalLengths.pop();
                int nextConditionalIndex = conditionalIndexes.pop();
                int thirdConditionalLength;
                int thirdConditionalIndex;
                if (reductionNumber != -1) {
                    currentConditionalLength += reductionNumber;
                    reductionNumber = -1;
                }
                int extraLength = (currentConditionalLength + currentConditionalIndex) - (nextConditionalIndex + nextConditionalLength);
                if (extraLength > 0) {
                    decompiled.add(getWhiteSpace() + "reduce(" + Long.toHexString(extraLength) + ")");

                    if (conditionalLengths.size() > 0) {
                        thirdConditionalLength = conditionalLengths.peek();
                        thirdConditionalIndex = conditionalIndexes.peek();
                        extraLength = (currentConditionalLength + currentConditionalIndex) - (thirdConditionalIndex + thirdConditionalLength);
                        if (extraLength > 0) {
                            reductionNumber = extraLength;
                        }
                    }
                }
                conditionalLengths.push(nextConditionalLength);
                conditionalIndexes.push(nextConditionalIndex);
            }
            processConditionals(input, currentIndex);
        }
    }
}
 
开发者ID:thane98,项目名称:3DSFE-Randomizer,代码行数:49,代码来源:EventDecompiler.java

示例3: encodeObjectAsQueryString

import java.util.AbstractMap.SimpleEntry; //导入方法依赖的package包/类
/**
 * Encodes a given object to url encoded string
 * @param name
 * @param obj
 * @param objBuilder
 */
private static void encodeObjectAsQueryString(
		String name, 
		Object obj, 
		StringBuilder objBuilder)
{
	try 
	{
        if(obj == null)
            return;

        List<SimpleEntry<String, Object>> objectList = new ArrayList<SimpleEntry<String, Object>>();
        objectToList(name, obj, objectList, new HashSet<Integer>());
        boolean hasParam = false;
                    
        for (SimpleEntry<String, Object> pair : objectList) 
        {
            String paramKeyValPair;
            String accessor = pair.getKey();
            //ignore nulls
            Object value = pair.getValue();
            if(value == null)
                continue;

            hasParam = true;
            //load element value as string
         paramKeyValPair = String.format("%s=%s&", accessor, tryUrlEncode(value.toString()));
         objBuilder.append(paramKeyValPair);

        }

        //remove the last &
        if(hasParam) 
        {
            objBuilder.setLength(objBuilder.length() - 1);
        }
    } 
	catch (Exception ex) 
	{
    }
}
 
开发者ID:messagemedia,项目名称:messages-java-sdk,代码行数:47,代码来源:APIHelper.java

示例4: initialize

import java.util.AbstractMap.SimpleEntry; //导入方法依赖的package包/类
private void initialize(
    Map<HRegionLocation, FlushWorker> serverToFlushWorkerMap) {
  if (serverToFlushWorkerMap == null) {
    return;
  }

  long averageCalcSum = 0;
  int averageCalcCount = 0;
  for (Map.Entry<HRegionLocation, FlushWorker> entry : serverToFlushWorkerMap
      .entrySet()) {
    HRegionLocation addr = entry.getKey();
    FlushWorker worker = entry.getValue();

    long bufferedCounter = worker.getTotalBufferedCount();
    long failedCounter = worker.getTotalFailedCount();
    long serverMaxLatency = worker.getMaxLatency();
    AtomicAverageCounter averageCounter = worker.getAverageLatencyCounter();
    // Get sum and count pieces separately to compute overall average
    SimpleEntry<Long, Integer> averageComponents = averageCounter
        .getComponents();
    long serverAvgLatency = averageCounter.getAndReset();

    this.totalBufferedPutCounter += bufferedCounter;
    this.totalFailedPutCounter += failedCounter;
    if (serverMaxLatency > this.maxLatency) {
      this.maxLatency = serverMaxLatency;
    }
    averageCalcSum += averageComponents.getKey();
    averageCalcCount += averageComponents.getValue();

    this.serverToBufferedCounterMap.put(addr.getHostnamePort(),
        bufferedCounter);
    this.serverToFailedCounterMap
        .put(addr.getHostnamePort(),
        failedCounter);
    this.serverToAverageLatencyMap.put(addr.getHostnamePort(),
        serverAvgLatency);
    this.serverToMaxLatencyMap
        .put(addr.getHostnamePort(),
        serverMaxLatency);
  }
  this.overallAverageLatency = averageCalcCount != 0 ? averageCalcSum
      / averageCalcCount : 0;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:45,代码来源:HTableMultiplexer.java


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