Example usage for com.google.common.collect RangeMap putAll

List of usage examples for com.google.common.collect RangeMap putAll

Introduction

In this page you can find the example usage for com.google.common.collect RangeMap putAll.

Prototype

void putAll(RangeMap<K, V> rangeMap);

Source Link

Document

Puts all the associations from rangeMap into this range map (optional operation).

Usage

From source file:org.mskcc.shenkers.data.interval.DiscreteRangeMap.java

public RangeMap<Integer, Double> add(RangeMap<Integer, Double> rm, Range<Integer> r, Double d) {
    RangeMap<Integer, Double> ram = TreeRangeMap.create();

    ram.putAll(rm);
    ram.put(r, d);/*w w  w  .  jav a2 s .  c o  m*/

    rm.subRangeMap(r).asMapOfRanges().forEach((range, val) -> ram.put(range, val + d));
    return ram;
}