本文整理匯總了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));
}