MCPcopy Create free account
hub / github.com/antlr/codebuff / range

Method range

corpus/java/training/guava/collect/Range.java:206–216  ·  view source on GitHub ↗

Returns a range that contains any value from lower to upper, where each endpoint may be either inclusive (closed) or exclusive (open). @throws IllegalArgumentException if lower is greater than upper @since 14.0

(
      C lower, BoundType lowerType, C upper, BoundType upperType)

Source from the content-addressed store, hash-verified

204 * @since 14.0
205 */
206 public static <C extends Comparable<?>> Range<C> range(
207 C lower, BoundType lowerType, C upper, BoundType upperType) {
208 checkNotNull(lowerType);
209 checkNotNull(upperType);
210
211 Cut<C> lowerBound =
212 (lowerType == BoundType.OPEN) ? Cut.aboveValue(lower) : Cut.belowValue(lower);
213 Cut<C> upperBound =
214 (upperType == BoundType.OPEN) ? Cut.belowValue(upper) : Cut.aboveValue(upper);
215 return create(lowerBound, upperBound);
216 }
217
218 /**
219 * Returns a range that contains all values strictly less than {@code

Callers 5

subMapMethod · 0.95
subMapMethod · 0.95
subMapMethod · 0.95
subSetImplMethod · 0.95
subSetImplMethod · 0.95

Calls 4

aboveValueMethod · 0.95
belowValueMethod · 0.95
createMethod · 0.95
checkNotNullMethod · 0.45

Tested by

no test coverage detected