當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。