/** * Returns a new range set consisting of the union of this range set and {@code other}. * * <p>This is essentially the same as {@code TreeRangeSet.create(this).addAll(other)} except it * returns an {@code ImmutableRangeSet}. * * @since 21.0 */ public ImmutableRangeSet<C> union(RangeSet<C> other) { return unionOf(Iterables.concat(asRanges(), other.asRanges())); }
/** * Returns a new range set consisting of the union of this range set and {@code other}. * * <p>This is essentially the same as {@code TreeRangeSet.create(this).addAll(other)} except it * returns an {@code ImmutableRangeSet}. * * @since 21.0 */ public ImmutableRangeSet<C> union(RangeSet<C> other) { return unionOf(Iterables.concat(asRanges(), other.asRanges())); }
/** * Returns a new range set consisting of the union of this range set and {@code other}. * * <p>This is essentially the same as {@code TreeRangeSet.create(this).addAll(other)} except it * returns an {@code ImmutableRangeSet}. * * @since 21.0 */ public ImmutableRangeSet<C> union(RangeSet<C> other) { return unionOf(Iterables.concat(asRanges(), other.asRanges())); }
subsets: for (Set<Range<Integer>> subset : Sets.powerSet(ranges)) { assertEquals(TreeRangeSet.create(subset), ImmutableRangeSet.unionOf(subset));
/** * Returns a new range set consisting of the union of this range set and {@code other}. * * <p>This is essentially the same as {@code TreeRangeSet.create(this).addAll(other)} except it * returns an {@code ImmutableRangeSet}. * * @since 21.0 */ public ImmutableRangeSet<C> union(RangeSet<C> other) { return unionOf(Iterables.concat(asRanges(), other.asRanges())); }
/** * Returns a new range set consisting of the union of this range set and {@code other}. * * <p>This is essentially the same as {@code TreeRangeSet.create(this).addAll(other)} except it * returns an {@code ImmutableRangeSet}. * * @since 21.0 */ public ImmutableRangeSet<C> union(RangeSet<C> other) { return unionOf(Iterables.concat(asRanges(), other.asRanges())); }
Range.open(3, 4)); subsets: for (Set<Range<Integer>> subset : Sets.powerSet(ranges)) { assertEquals(TreeRangeSet.create(subset), ImmutableRangeSet.unionOf(subset));