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


Java ImmutableRangeSet.copyOf方法代码示例

本文整理汇总了Java中com.google.common.collect.ImmutableRangeSet.copyOf方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutableRangeSet.copyOf方法的具体用法?Java ImmutableRangeSet.copyOf怎么用?Java ImmutableRangeSet.copyOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.collect.ImmutableRangeSet的用法示例。


在下文中一共展示了ImmutableRangeSet.copyOf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CrontabEntry

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的package包/类
private CrontabEntry(
    RangeSet<Integer> minute,
    RangeSet<Integer> hour,
    RangeSet<Integer> dayOfMonth,
    RangeSet<Integer> month,
    RangeSet<Integer> dayOfWeek) {

  checkEnclosed("minute", MINUTE, minute);
  checkEnclosed("hour", HOUR, hour);
  checkEnclosed("dayOfMonth", DAY_OF_MONTH, dayOfMonth);
  checkEnclosed("month", MONTH, month);
  checkEnclosed("dayOfWeek", DAY_OF_WEEK, dayOfWeek);

  this.minute = ImmutableRangeSet.copyOf(minute);
  this.hour = ImmutableRangeSet.copyOf(hour);
  this.dayOfMonth = ImmutableRangeSet.copyOf(dayOfMonth);
  this.month = ImmutableRangeSet.copyOf(month);
  this.dayOfWeek = ImmutableRangeSet.copyOf(dayOfWeek);

  checkArgument(hasWildcardDayOfMonth() || hasWildcardDayOfWeek(),
      "Specifying both dayOfWeek and dayOfMonth is not supported.");
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:23,代码来源:CrontabEntry.java

示例2: FrontendHistoryMetadata

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的package包/类
public FrontendHistoryMetadata(final long historyId, final long cookie, final boolean closed,
        final Map<UnsignedLong, Boolean> closedTransactions, final RangeSet<UnsignedLong> purgedTransactions) {
    this.historyId = historyId;
    this.cookie = cookie;
    this.closed = closed;
    this.closedTransactions = ImmutableMap.copyOf(closedTransactions);
    this.purgedTransactions = ImmutableRangeSet.copyOf(purgedTransactions);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:9,代码来源:FrontendHistoryMetadata.java

示例3: parseMinute

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的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

示例4: parseHour

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的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

示例5: parseDayOfWeek

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的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

示例6: parseMonth

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的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

示例7: parseDayOfMonth

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的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

示例8: addRange

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的package包/类
protected final CharacterClassRangeSet addRange(int from, int to) {
    final RangeSet<Integer> mutableRangeSet = TreeRangeSet.create(rangeSet);

    mutableRangeSet.add(Range.closed(from, Math.min(255, to)));

    return new CharacterClassRangeSet(ImmutableRangeSet.copyOf(mutableRangeSet),
        containsEOF || to == CharacterClassFactory.EOF_INT);
}
 
开发者ID:metaborg,项目名称:sdf,代码行数:9,代码来源:CharacterClassRangeSet.java

示例9: addSingle

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的package包/类
protected final CharacterClassRangeSet addSingle(int character) {
    final RangeSet<Integer> mutableRangeSet = TreeRangeSet.create(rangeSet);

    if(character < CharacterClassFactory.EOF_INT)
        mutableRangeSet.add(Range.singleton(character));

    return new CharacterClassRangeSet(ImmutableRangeSet.copyOf(mutableRangeSet),
        containsEOF || character == CharacterClassFactory.EOF_INT);
}
 
开发者ID:metaborg,项目名称:sdf,代码行数:10,代码来源:CharacterClassRangeSet.java

示例10: removeSingle

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的package包/类
protected final CharacterClassRangeSet removeSingle(int character) {
    final RangeSet<Integer> mutableRangeSet = TreeRangeSet.create(rangeSet);

    if(character < CharacterClassFactory.EOF_INT)
        mutableRangeSet.remove(Range.open(character - 1, character + 1));

    return new CharacterClassRangeSet(ImmutableRangeSet.copyOf(mutableRangeSet),
        containsEOF && character != CharacterClassFactory.EOF_INT);
}
 
开发者ID:metaborg,项目名称:sdf,代码行数:10,代码来源:CharacterClassRangeSet.java

示例11: rangeSetIntersection

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的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

示例12: toImmutable

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的package包/类
public RangeSet<UnsignedLong> toImmutable() {
    return ImmutableRangeSet.copyOf(rangeset);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:4,代码来源:UnsignedLongRangeSet.java

示例13: FrontendClientMetadata

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的package包/类
public FrontendClientMetadata(final ClientIdentifier identifier, final RangeSet<UnsignedLong> purgedHistories,
        final Collection<FrontendHistoryMetadata> currentHistories) {
    this.identifier = Preconditions.checkNotNull(identifier);
    this.purgedHistories = ImmutableRangeSet.copyOf(purgedHistories);
    this.currentHistories = ImmutableList.copyOf(currentHistories);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:FrontendClientMetadata.java

示例14: DeadTransactionException

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的package包/类
public DeadTransactionException(final RangeSet<UnsignedLong> purgedIdentifiers) {
    super("Transactions " + purgedIdentifiers + " have been purged");
    this.purgedIdentifiers = ImmutableRangeSet.copyOf(purgedIdentifiers);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:DeadTransactionException.java

示例15: ResolvedRangeConstraint

import com.google.common.collect.ImmutableRangeSet; //导入方法依赖的package包/类
ResolvedRangeConstraint(final ConstraintMetaDefinition meta, final RangeSet<T> ranges) {
    this.meta = requireNonNull(meta);
    this.ranges = ImmutableRangeSet.copyOf(ranges);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:5,代码来源:ResolvedRangeConstraint.java


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