question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add Interval implementation

See original GitHub issue

Add an Interval implementation like:

data class Interval(val from: Instant, val to: Instant)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
imanushincommented, Aug 14, 2020

I think think class can be extended:

data class Interval(override val start: Instant, override val endInclusive: Instant): ClosedRange<Instant> {
      init {
           require(start <= endInclusive) {
                 "Start should be before end, actual data: $this
           }
      }
}

Also I think we can also support sequences generation via implementing feature like this.

0reactions
Whathecodecommented, Aug 2, 2022

Update: I now included and published InstantInterval on Maven as part of the Whathecode/kotlinx-interval library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Insert Interval - LeetCode
Insert newInterval into intervals such that intervals is still sorted in ascending order by start i and intervals still does not have any...
Read more >
Insert in sorted and non-overlapping interval array
Given a set of non-overlapping intervals and a new interval, insert the interval at correct position. If the insertion results in overlapping  ......
Read more >
Add interval to a datetime - java - Stack Overflow
Where to obtain the java.time classes? Java SE 8 and SE 9 and later. Built-in. Part of the standard Java API with a...
Read more >
4.8.5 Implementation of rounded interval arithmetic
Interval c; add(a, b, c); // call appropriate utility function return c; // return sum of a and b } Software rounding using...
Read more >
setInterval() - Web APIs - MDN Web Docs
It's possible for intervals to be nested; that is, the callback for setInterval() can in turn call setInterval() to start another interval ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found