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.
- Since:
- 14.0
- Author:
- Louis Wasserman
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd the specified range to this builder.Add all ranges from the specified range set to this builder.Add all of the specified ranges 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 ranges are permitted and will be merged, but overlapping ranges will cause an exception whenbuild()
is called.- Throws:
IllegalArgumentException
- ifrange
is empty
-
addAll
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 whenbuild()
is called. -
addAll
Add all of the specified ranges to this builder. Adjacent ranges are permitted and will be merged, but overlapping ranges will cause an exception whenbuild()
is called.- Throws:
IllegalArgumentException
- if any inserted ranges are empty- Since:
- 21.0
-
build
Returns anImmutableRangeSet
containing the ranges added to this builder.- Throws:
IllegalArgumentException
- if any input ranges have nonempty overlap
-