-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a gap method to Range which computes the range that lies between …
…two ranges. This operation is particularly useful as a replacement for Joda Time's Interval.gap when migrating to Java Time which has no Interval class. Joda Time: Interval interval = ...; Interval gap = interval.gap(interval); Java Time (after this CL): Range<Instant> interval = ...; Range<Instant> gap = interval.gap(otherInterval); RELNOTES=Adds a gap() method to Range that computes the Range that lies between them. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=208259360
- Loading branch information
1 parent
f264e96
commit a9dd709
Showing
5 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a9dd709
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, we should got IAE insteadof AssertionError.
java.lang.AssertionError at com.google.common.collect.Cut$AboveAll.describeAsLowerBound(Cut.java:259) at com.google.common.collect.Range.toString(Range.java:674) at com.google.common.collect.Range.<init>(Range.java:357) at com.google.common.collect.Range.create(Range.java:155) at com.google.common.collect.Range.gap(Range.java:582)
a9dd709
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, thank you. #4004