Class ImmutableRangeSet.Builder<C extends <?>>

  • Enclosing class:
    >

    public static class <?>>
    extends 
    A builder for immutable range sets.
    Since:
    14.0
    • Constructor Detail

    • Method Detail

      • add

        public ImmutableRangeSet.Builder<Cadd​(Range<C> range)
        Add the specified range to this builder. Adjacent ranges are permitted and will be merged, but overlapping ranges will cause an exception when build() is called.
        Throws:
        - if range is empty
      • addAll

        public ImmutableRangeSet.Builder<CaddAll​(RangeSet<C> ranges)
        Add all ranges from the specified range set to this builder. Adjacent ranges are permitted and will be merged, but overlapping ranges will cause an exception when build() is called.
      • addAll

        public <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:
        - if any inserted ranges are empty
        Since:
        21.0
      • build

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