本文整理汇总了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();
}
示例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);
}
}
}
示例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)
{
}
}
示例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;
}