Package com.google.common.collect
Class ImmutableRangeSet.Builder<C extends Comparable<?>>
java.lang.Object
com.google.common.collect.ImmutableRangeSet.Builder<C>
- Enclosing class:
ImmutableRangeSet<C extends Comparable>
A builder for immutable range sets.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd the specified range to this builder.Add all ranges from the specified range set to this builder.build()
Returns anImmutableRangeSet
containing the ranges added to this builder.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
add
Add the specified range to this builder. Adjacent/abutting ranges are permitted, but empty ranges, or ranges with nonempty overlap, are forbidden.- Throws:
IllegalArgumentException
- ifrange
is empty or has nonempty intersection with any ranges already added to the builder
-
addAll
Add all ranges from the specified range set to this builder. Duplicate or connected ranges are permitted, and will be merged in the resulting immutable range set. -
build
Returns anImmutableRangeSet
containing the ranges added to this builder.
-