Example usage for com.google.common.collect Ranges range

List of usage examples for com.google.common.collect Ranges range

Introduction

In this page you can find the example usage for com.google.common.collect Ranges range.

Prototype

public static <C extends Comparable<?>> Range<C> range(C paramC1, BoundType paramBoundType1, C paramC2,
              BoundType paramBoundType2) 

Source Link

Usage

From source file:org.eclipse.smarthome.transform.scale.internal.ScaleTransformationService.java

private Range<Double> getRange(BoundType lowBoundType, BoundType highBoundType, Double lowValue,
        Double highValue) {/*from  w ww. ja v  a 2s .c o  m*/

    if (lowValue == null && highValue == null) {
        return Ranges.all();
    } else if (lowValue == null) {
        return Ranges.upTo(highValue, highBoundType);
    } else if (highValue == null) {
        return Ranges.downTo(lowValue, lowBoundType);
    } else {
        return Ranges.range(lowValue, lowBoundType, highValue, highBoundType);
    }

}