本文整理汇总了Java中com.google.common.collect.Range.atLeast方法的典型用法代码示例。如果您正苦于以下问题:Java Range.atLeast方法的具体用法?Java Range.atLeast怎么用?Java Range.atLeast使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.Range
的用法示例。
在下文中一共展示了Range.atLeast方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRangeMap
import com.google.common.collect.Range; //导入方法依赖的package包/类
protected RangeMap<Integer, ScenarioDefinition> getRangeMap(FeatureWrapper feature) {
List<ScenarioDefinition> children = Lists.newArrayList(feature.getChildren());
ImmutableRangeMap.Builder<Integer, ScenarioDefinition> builder = ImmutableRangeMap.builder();
while (!children.isEmpty()) {
ScenarioDefinition child = children.remove(0);
Location location = child.getLocation();
Integer childStart = location.getLine();
ScenarioDefinition sibling = children.isEmpty() ? null : children.get(0);
Location siblingLocation = null == sibling ? null : sibling.getLocation();
Integer siblingStart = null == siblingLocation ? null : siblingLocation.getLine();
Range<Integer> range = null == siblingStart ? Range.atLeast(childStart) : Range.closedOpen(childStart, siblingStart);
builder.put(range, child);
}
return builder.build();
}
示例2: buildProgressAsset
import com.google.common.collect.Range; //导入方法依赖的package包/类
private ProgressAsset buildProgressAsset(Map<Integer, List<ShowImageDTO>> resolvedConfig, int index) {
ProgressAsset progressAsset = new ProgressAsset(index);
int lowerBound = Integer.MIN_VALUE;
ShowImageDTO imageDTO = new ShowImageDTO("", new Size(0, 0));
for (Entry<Integer, List<ShowImageDTO>> element : resolvedConfig.entrySet()) {
Range<Integer> range = Range.closedOpen(lowerBound, element.getKey());
progressAsset.add(range, imageDTO);
lowerBound = element.getKey();
imageDTO = getElementAtIndex(element.getValue(), index);
}
Range<Integer> lastRange = Range.atLeast(lowerBound);
progressAsset.add(lastRange, imageDTO);
return progressAsset;
}
示例3: parseKillStreak
import com.google.common.collect.Range; //导入方法依赖的package包/类
@MethodParser("kill-streak")
public KillStreakFilter parseKillStreak(Element el) throws InvalidXMLException {
boolean repeat = XMLUtils.parseBoolean(el.getAttribute("repeat"), false);
boolean persistent = XMLUtils.parseBoolean(el.getAttribute("persistent"), false);
Integer count = XMLUtils.parseNumber(el.getAttribute("count"), Integer.class, (Integer) null);
Integer min = XMLUtils.parseNumber(el.getAttribute("min"), Integer.class, (Integer) null);
Integer max = XMLUtils.parseNumber(el.getAttribute("max"), Integer.class, (Integer) null);
Range<Integer> range;
if(count != null) {
range = Range.singleton(count);
} else if(min == null) {
if(max == null) {
throw new InvalidXMLException("kill-streak filter must have a count, min, or max", el);
} else {
range = Range.atMost(max);
}
} else {
if(max == null) {
range = Range.atLeast(min);
} else {
range = Range.closed(min, max);
}
}
if(repeat && !range.hasUpperBound()) {
throw new InvalidXMLException("repeating kill-streak filter must have a count or max", el);
}
return new KillStreakFilter(range, repeat, persistent);
}
示例4: toRange
import com.google.common.collect.Range; //导入方法依赖的package包/类
public static Range toRange(Coprocessor.KeyRange range) {
if (range == null || (range.getStart().isEmpty() && range.getEnd().isEmpty())) {
return Range.all();
}
if (range.getStart().isEmpty()) {
return Range.lessThan(Comparables.wrap(range.getEnd()));
}
if (range.getEnd().isEmpty()) {
return Range.atLeast(Comparables.wrap(range.getStart()));
}
return Range.closedOpen(Comparables.wrap(range.getStart()), Comparables.wrap(range.getEnd()));
}
示例5: makeRange
import com.google.common.collect.Range; //导入方法依赖的package包/类
public static Range makeRange(ByteString startKey, ByteString endKey) {
if (startKey.isEmpty() && endKey.isEmpty()) {
return Range.all();
}
if (startKey.isEmpty()) {
return Range.lessThan(Comparables.wrap(endKey));
} else if (endKey.isEmpty()) {
return Range.atLeast(Comparables.wrap(startKey));
}
return Range.closedOpen(Comparables.wrap(startKey), Comparables.wrap(endKey));
}