private static ImmutableSortedMap<Integer, BigDecimal> buildGammaMap(Map<Integer, BigDecimal> gammaInput) {
ImmutableSortedMap.Builder<Integer, BigDecimal> mapBuilder = ImmutableSortedMap.naturalOrder();
SortedMap<Integer, BigDecimal> sortedInput = new TreeMap<>(gammaInput);
Preconditions.checkArgument(sortedInput.firstKey() == 1,
"Gamma Values must (exclusively) be specified for quantities 1 and (optionally) higher",
sortedInput);
Preconditions.checkArgument(sortedInput.lastKey().equals(sortedInput.size()), ""
+ "Gamma Values must be specified for all capacities in {0, ..., k_{max}}, where k_{max} > 0 is any natural number > 0",
sortedInput);
for (Entry<Integer, BigDecimal> inputGammaEntry : sortedInput.entrySet()) {
Preconditions.checkArgument(inputGammaEntry.getValue().compareTo(BigDecimal.ZERO) >= 0, "Gamma must not be negative", inputGammaEntry);
mapBuilder.put(inputGammaEntry);
}
return mapBuilder.build();
}
MRVMNationalBidder.java 文件源码
java
阅读 28
收藏 0
点赞 0
评论 0
项目:sats-core
作者:
评论列表
文章目录