public void testSpanEmpty() { try { ImmutableRangeMap.of().span(); fail("Expected NoSuchElementException"); } catch (NoSuchElementException expected) { } }
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;
/** * A builder for immutable range maps. Overlapping ranges are prohibited. * * @since 14.0 */ public static final class Builder<K extends Comparable<?>, V> { private final List<Entry<Range<K>, V>> entries; public Builder() { this.entries = Lists.newArrayList(); } /** * Associates the specified range with the specified value. * * @throws IllegalArgumentException if {@code range} is empty */ @CanIgnoreReturnValue public Builder<K, V> put(Range<K> range, V value) { checkNotNull(range); checkNotNull(value); checkArgument(!range.isEmpty(), "Range must not be empty, but was %s", range); entries.add(Maps.immutableEntry(range, value)); return this; } /** Copies all associations from the specified range map into this builder. */ @CanIgnoreReturnValue public Builder<K, V> putAll(RangeMap<K, ? extends V> rangeMap) { for (Entry<Range<K>, ? extends V> entry : rangeMap.asMapOfRanges().entrySet()) {
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;
public void testSpanEmpty() { try { ImmutableRangeMap.of().span(); fail("Expected NoSuchElementException"); } catch (NoSuchElementException expected) { } }
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;
if (checkNotNull(range).isEmpty()) { return ImmutableRangeMap.of(); } else if (ranges.isEmpty() || range.encloses(span())) { return this;