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

Method from

corpus/java/training/guava/collect/GeneralRange.java:44–58  ·  view source on GitHub ↗

Converts a Range to a GeneralRange.

(Range<T> range)

Source from the content-addressed store, hash-verified

42 * Converts a Range to a GeneralRange.
43 */
44 static <T extends Comparable> GeneralRange<T> from(Range<T> range) {
45 @Nullable T lowerEndpoint = range.hasLowerBound() ? range.lowerEndpoint() : null;
46 BoundType lowerBoundType = range.hasLowerBound() ? range.lowerBoundType() : OPEN;
47
48 @Nullable T upperEndpoint = range.hasUpperBound() ? range.upperEndpoint() : null;
49 BoundType upperBoundType = range.hasUpperBound() ? range.upperBoundType() : OPEN;
50 return new GeneralRange<T>(
51 Ordering.natural(),
52 range.hasLowerBound(),
53 lowerEndpoint,
54 lowerBoundType,
55 range.hasUpperBound(),
56 upperEndpoint,
57 upperBoundType);
58 }
59
60 /**
61 * Returns the whole range relative to the specified comparator.

Callers

nothing calls this directly

Calls 7

naturalMethod · 0.95
hasLowerBoundMethod · 0.45
lowerEndpointMethod · 0.45
lowerBoundTypeMethod · 0.45
hasUpperBoundMethod · 0.45
upperEndpointMethod · 0.45
upperBoundTypeMethod · 0.45

Tested by

no test coverage detected