本文整理匯總了Java中org.apache.commons.lang3.tuple.MutablePair.getKey方法的典型用法代碼示例。如果您正苦於以下問題:Java MutablePair.getKey方法的具體用法?Java MutablePair.getKey怎麽用?Java MutablePair.getKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.commons.lang3.tuple.MutablePair
的用法示例。
在下文中一共展示了MutablePair.getKey方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getComment
import org.apache.commons.lang3.tuple.MutablePair; //導入方法依賴的package包/類
@Override
@Nullable
public String getComment(String path)
{
MutablePair<String, CommentsNodeImpl> nodePair = this.dataMap.get(path);
if (nodePair != null)
{
String comment = nodePair.getLeft();
if (comment != null)
{
return comment;
}
}
MutablePair<String, CommentsNodeImpl> anyNodePair = this.dataMap.get(ANY);
if (anyNodePair != null)
{
return anyNodePair.getKey();
}
return null;
}
示例2: getSysNetworkTraffic
import org.apache.commons.lang3.tuple.MutablePair; //導入方法依賴的package包/類
public static MutablePair<Double, Double> getSysNetworkTraffic(long samplingWindowInMs)
throws Exception {
MutablePair<Long, Long> startNumbers = getProcNetDevStats();
Thread.sleep(samplingWindowInMs);
MutablePair<Long, Long> endNumbers = getProcNetDevStats();
double inRate = (endNumbers.getKey() - startNumbers.getKey()) * 1000.0 / samplingWindowInMs;
double outRate =
(endNumbers.getValue() - startNumbers.getValue()) * 1000.0 / samplingWindowInMs;
MutablePair<Double, Double> result = new MutablePair<>(inRate, outRate);
return result;
}