public class Range<T extends Comparable<T>> extends Object
Constructor and Description |
---|
Range(T lowerBound,
T upperBound)
Creates a new
Range with the given lower and upper bound. |
Range(T lowerBound,
T upperBound,
boolean lowerInclusive,
boolean upperInclusive)
Creates a new
Range with the given lower and upper bound as well as the given inclusive/exclusive
semantics. |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T value)
Returns whether the
Range contains the given value. |
public Range(T lowerBound, T upperBound)
Range
with the given lower and upper bound. Treats the given values as inclusive bounds. Use
Range(Comparable, Comparable, boolean, boolean)
to configure different bound behavior.lowerBound
- can be null in case upperBound is not null.upperBound
- can be null in case lowerBound is not null.Range(Comparable, Comparable, boolean, boolean)
public Range(T lowerBound, T upperBound, boolean lowerInclusive, boolean upperInclusive)
Range
with the given lower and upper bound as well as the given inclusive/exclusive
semantics.lowerBound
- can be null.upperBound
- can be null.lowerInclusive
- upperInclusive
- Copyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.