当前位置: 首页>>代码示例>>Java>>正文


Java Range.atLeast方法代码示例

本文整理汇总了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();
}
 
开发者ID:qas-guru,项目名称:martini-core,代码行数:19,代码来源:DefaultMixology.java

示例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;
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:16,代码来源:ProgressAssetProvider.java

示例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);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:32,代码来源:FilterDefinitionParser.java

示例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()));
}
 
开发者ID:pingcap,项目名称:tikv-client-lib-java,代码行数:13,代码来源:KeyRangeUtils.java

示例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));
}
 
开发者ID:pingcap,项目名称:tikv-client-lib-java,代码行数:12,代码来源:KeyRangeUtils.java


注:本文中的com.google.common.collect.Range.atLeast方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。