Class ImmutableRangeSet.Builder<C extends java.lang.Comparable<?>>

  • Enclosing class:
    ImmutableRangeSet<C extends java.lang.Comparable>

    public static class ImmutableRangeSet.Builder<C extends java.lang.Comparable<?>>
    extends java.lang.Object
    A builder for immutable range sets.
    Since:
    14.0
    • Constructor Detail

    • Method Detail

      • addAll

        @CanIgnoreReturnValue
        public ImmutableRangeSet.Builder<CaddAll​(java.lang.Iterable<Range<C>> ranges)
        Add all of the specified ranges to this builder. Adjacent ranges are permitted and will be merged, but overlapping ranges will cause an exception when build() is called.
        Throws:
        java.lang.IllegalArgumentException - if any inserted ranges are empty
        Since:
        21.0
      • build

        public ImmutableRangeSet<Cbuild()
        Returns an ImmutableRangeSet containing the ranges added to this builder.
        Throws:
        java.lang.IllegalArgumentException - if any input ranges have nonempty overlap