當前位置: 首頁>>代碼示例>>Java>>正文


Java RangeSet.addAll方法代碼示例

本文整理匯總了Java中com.google.common.collect.RangeSet.addAll方法的典型用法代碼示例。如果您正苦於以下問題:Java RangeSet.addAll方法的具體用法?Java RangeSet.addAll怎麽用?Java RangeSet.addAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.common.collect.RangeSet的用法示例。


在下文中一共展示了RangeSet.addAll方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: parseMinute

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
private RangeSet<Integer> parseMinute() {
  RangeSet<Integer> minutes = TreeRangeSet.create();
  for (String component : getComponents(rawMinute)) {
    minutes.addAll(parseComponent(MINUTE, component));
  }
  return ImmutableRangeSet.copyOf(minutes);
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Mesos,代碼行數:8,代碼來源:CrontabEntry.java

示例2: parseHour

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
private RangeSet<Integer> parseHour() {
  RangeSet<Integer> hours = TreeRangeSet.create();
  for (String component : getComponents(rawHour)) {
    hours.addAll(parseComponent(HOUR, component));
  }
  return ImmutableRangeSet.copyOf(hours);
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Mesos,代碼行數:8,代碼來源:CrontabEntry.java

示例3: parseDayOfWeek

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
private RangeSet<Integer> parseDayOfWeek() {
  RangeSet<Integer> daysOfWeek = TreeRangeSet.create();
  for (String component : getComponents(rawDayOfWeek)) {
    daysOfWeek.addAll(parseComponent(DAY_OF_WEEK, replaceNameAliases(component, DAY_NAMES)));
  }
  return ImmutableRangeSet.copyOf(daysOfWeek);
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Mesos,代碼行數:8,代碼來源:CrontabEntry.java

示例4: parseMonth

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
private RangeSet<Integer> parseMonth() {
  RangeSet<Integer> months = TreeRangeSet.create();
  for (String component : getComponents(rawMonth)) {
    months.addAll(parseComponent(MONTH, replaceNameAliases(component, MONTH_NAMES)));
  }
  return ImmutableRangeSet.copyOf(months);
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Mesos,代碼行數:8,代碼來源:CrontabEntry.java

示例5: parseDayOfMonth

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
private RangeSet<Integer> parseDayOfMonth() {
  RangeSet<Integer> daysOfMonth = TreeRangeSet.create();
  for (String component : getComponents(rawDayOfMonth)) {
    daysOfMonth.addAll(parseComponent(DAY_OF_MONTH, component));
  }
  return ImmutableRangeSet.copyOf(daysOfMonth);
}
 
開發者ID:PacktPublishing,項目名稱:Mastering-Mesos,代碼行數:8,代碼來源:CrontabEntry.java

示例6: positiveFn

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
public static CodePointSet positiveFn(Set<RangeRep> ranges) {
	RangeSet<Integer> rangeSet = TreeRangeSet.create();
	for ( RangeRep rangeRep : ranges ) {
		rangeSet.addAll( rangeRep.getRangeSet() );
	}
	return CodePointSet.range( RangeRep.of( rangeSet ) );
}
 
開發者ID:s4ke,項目名稱:moar,代碼行數:8,代碼來源:CharacterClassesUtils.java

示例7: intersectionThis

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
public void intersectionThis(P2PBlobRangeSet otherRangeSet) {
  RangeSet<Integer> intersection=TreeRangeSet.create();
  for(Range<Integer> otherRange: otherRangeSet.ranges.asRanges()){
    intersection.addAll(ranges.subRangeSet(otherRange));
  }
  ranges=intersection;
}
 
開發者ID:pmarches,項目名稱:peercentrum-core,代碼行數:8,代碼來源:P2PBlobRangeSet.java

示例8: add

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
EncodedDiscreteResources add(EncodedDiscreteResources other) {
    checkArgument(this.codec.getClass() == other.codec.getClass());

    RangeSet<Integer> newRangeSet = TreeRangeSet.create(this.rangeSet);
    newRangeSet.addAll(other.rangeSet);

    return new EncodedDiscreteResources(newRangeSet, this.codec);
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:9,代碼來源:EncodedDiscreteResources.java

示例9: rangeSetIntersection

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
public CharacterClassRangeSet rangeSetIntersection(CharacterClassRangeSet other) {
    final RangeSet<Integer> mutableRangeSet = TreeRangeSet.create();

    for(Range<Integer> range : this.rangeSet.asRanges()) {
        mutableRangeSet.addAll(other.rangeSet.subRangeSet(range));
    }

    boolean containsEOF = this.containsEOF && other.containsEOF;

    return new CharacterClassRangeSet(ImmutableRangeSet.copyOf(mutableRangeSet), containsEOF);
}
 
開發者ID:metaborg,項目名稱:sdf,代碼行數:12,代碼來源:CharacterClassRangeSet.java

示例10: add

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
/**
 * This add method gradually removes scan-ranges from the input range as it
 * descends down the hierarchy.
 * @param range
 */
public void add(LCMSRange range) {
    Integer msLevel = range.getMsLevel();
    DoubleRange mzRange = range.getMzRange();
    Range<Integer> scanRange = range.getScanRange();

    if (msLevel == null) {
        // add to the top level range set
        anyLvlSet.add(scanRange);
        // remove from all underlying sets
        for (Map.Entry<Integer, MsLevelRangeSet> lvlMapEntry : lvlMap.entrySet()) {
            MsLevelRangeSet msLevelRangeSet = lvlMapEntry.getValue();
            msLevelRangeSet.removeFromAll(range);
        }
        return;
    }

    TreeRangeSet<Integer> scanRangeLeft = TreeRangeSet.create();
    scanRangeLeft.removeAll(anyLvlSet);
    if (scanRangeLeft.isEmpty()) {
        return; // if there's nothing left in the scan range, just stop
    }

    MsLevelRangeSet msLvlRanges = lvlMap.get(msLevel);
    if (msLvlRanges == null) {
        msLvlRanges = new MsLevelRangeSet();
        lvlMap.put(msLevel, msLvlRanges);
    }
    if (mzRange == null) {
        // add to any-mz-range range set
        msLvlRanges.anyPrecursorSet.addAll(scanRangeLeft);
        // remove from all specific mz-range sets
        msLvlRanges.removeFromSpecific(range);
        return;
    }

    scanRangeLeft.removeAll(msLvlRanges.anyPrecursorSet);
    if (scanRangeLeft.isEmpty()) {
        return;
    }

    RangeSet<Integer> rangeSetForMzRange = msLvlRanges.rngMap.get(mzRange);
    if (rangeSetForMzRange == null) {
        rangeSetForMzRange = TreeRangeSet.create();
        msLvlRanges.rngMap.put(mzRange, rangeSetForMzRange);
    }
    rangeSetForMzRange.addAll(scanRangeLeft);
}
 
開發者ID:chhh,項目名稱:MSFTBX,代碼行數:53,代碼來源:LCMSRangeSet.java

示例11: rangeSetUnion

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
public final CharacterClassRangeSet rangeSetUnion(CharacterClassRangeSet other) {
    final RangeSet<Integer> mutableRangeSet = TreeRangeSet.create();

    mutableRangeSet.addAll(this.rangeSet);
    mutableRangeSet.addAll(other.rangeSet);

    boolean containsEOF = this.containsEOF || other.containsEOF;

    return new CharacterClassRangeSet(ImmutableRangeSet.copyOf(mutableRangeSet), containsEOF);
}
 
開發者ID:metaborg,項目名稱:sdf,代碼行數:11,代碼來源:CharacterClassRangeSet.java

示例12: rangeSetDifference

import com.google.common.collect.RangeSet; //導入方法依賴的package包/類
public CharacterClassRangeSet rangeSetDifference(CharacterClassRangeSet other) {
    final RangeSet<Integer> mutableRangeSet = TreeRangeSet.create();

    mutableRangeSet.addAll(other.rangeSet);
    mutableRangeSet.removeAll(this.rangeSet);

    boolean containsEOF = other.containsEOF && !this.containsEOF;

    return new CharacterClassRangeSet(ImmutableRangeSet.copyOf(mutableRangeSet), containsEOF);
}
 
開發者ID:metaborg,項目名稱:sdf,代碼行數:11,代碼來源:CharacterClassRangeSet.java


注:本文中的com.google.common.collect.RangeSet.addAll方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。