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

Method from

output/java_guava/1.4.17/GeneralRange.java:43–56  ·  view source on GitHub ↗

Converts a Range to a GeneralRange.

(Range<T> range)

Source from the content-addressed store, hash-verified

41 * Converts a Range to a GeneralRange.
42 */
43 static <T extends Comparable> GeneralRange<T> from(Range<T> range) {
44 @Nullable T lowerEndpoint = range.hasLowerBound() ? range.lowerEndpoint() : null;
45 BoundType lowerBoundType = range.hasLowerBound() ? range.lowerBoundType() : OPEN;
46 @Nullable T upperEndpoint = range.hasUpperBound() ? range.upperEndpoint() : null;
47 BoundType upperBoundType = range.hasUpperBound() ? range.upperBoundType() : OPEN;
48 return new GeneralRange<T>(
49 Ordering.natural(),
50 range.hasLowerBound(),
51 lowerEndpoint,
52 lowerBoundType,
53 range.hasUpperBound(),
54 upperEndpoint,
55 upperBoundType);
56 }
57
58 /**
59 * 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