Package com.google.common.collect
Class ImmutableRangeMap.Builder<K extends Comparable<?>,V>
java.lang.Object
com.google.common.collect.ImmutableRangeMap.Builder<K,V>
- Enclosing class:
ImmutableRangeMap<K extends Comparable<?>,
V>
A builder for immutable range maps. Overlapping ranges are prohibited.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns anImmutableRangeMap
containing the associations previously added to this builder.Associates the specified range with the specified value.Copies all associations from the specified range map into this builder.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
put
Associates the specified range with the specified value.- Throws:
IllegalArgumentException
- ifrange
overlaps with any other ranges inserted into this builder, or ifrange
is empty
-
putAll
Copies all associations from the specified range map into this builder.- Throws:
IllegalArgumentException
- if any of the ranges inrangeMap
overlap with ranges already in this builder
-
build
Returns anImmutableRangeMap
containing the associations previously added to this builder.
-