本文整理汇总了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;
}