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 anImmutableRangeMapcontaining 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- ifrangeoverlaps with any other ranges inserted into this builder, or ifrangeis empty
-
putAll
Copies all associations from the specified range map into this builder.- Throws:
IllegalArgumentException- if any of the ranges inrangeMapoverlap with ranges already in this builder
-
build
Returns anImmutableRangeMapcontaining the associations previously added to this builder.
-