dmfs / lib-recur

A recurrence processor for Java
Apache License 2.0
198 stars 47 forks source link

How to determine if the set is infinite? #131

Closed dgudim closed 7 months ago

dgudim commented 9 months ago

On prior versions, I could call rSet.isInfinite(), but now it's deprecated. How do I do it in the new version? Sorry if I am not getting something

dmfs commented 9 months ago

hmm... that's something that the new Iterable adapter doesn't support (yet). Can you show an example of how you would use this? The Iterable implementation was intended to do only that, iterate. I'm wondering if we should extend it with this functionality or provide another way to get this info.

dgudim commented 9 months ago

Here: https://github.com/dgudim/Scheduler/blob/master/app/src/main/java/prototype/xd/scheduler/entities/SystemCalendarEvent.java Line 136 I want to know when the event ends, I can probably look more into it, maybe I can skip the infinity check

dmfs commented 9 months ago

got it. to make this work well, I'll add a few more classes and refactor the new Iterator a bit. That should be possible without any breaking changes.

dmfs commented 7 months ago

It took a while, but I've finally come to settle for a new design that should be more future proof. It's an improved version of the one I introduced before but fixes a few issues of it. First benchmarks seemed to indicate that the new implementation is even a bit faster than the previous ones. The most significant change is that it no longer returns long timestamps but DateTime values. In future I'll provide adapters to return java time instants.