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

Method canonical

output/java_guava/1.4.16/Range.java:655–660  ·  view source on GitHub ↗

Returns the canonical form of this range in the given domain. The canonical form has the following properties: equivalence: a.canonical().contains(v) == a.contains(v) for all v (in other words, {@code ContiguousSet.create(a.canonical(domain), domain).equals( Contigu

(DiscreteDomain<C> domain)

Source from the content-addressed store, hash-verified

653
654
655 public Range<C> canonical(DiscreteDomain<C> domain) {
656 checkNotNull(domain);
657 Cut<C> lower = lowerBound.canonical(domain);
658 Cut<C> upper = upperBound.canonical(domain);
659 return (lower == lowerBound && upper == upperBound) ? this : create(lower, upper);
660 }
661
662 /**
663 * Returns {@code true} if {@code object} is a range having the same endpoints and bound types as

Callers 1

asSetMethod · 0.45

Calls 2

createMethod · 0.95
checkNotNullMethod · 0.45

Tested by

no test coverage detected