Class EffectiveInstancesIterator
java.lang.Object
org.dmfs.rfc5545.instanceiterator.EffectiveInstancesIterator
- All Implemented Interfaces:
Iterator<org.dmfs.rfc5545.DateTime>,InstanceIterator
An iterator for recurrence sets. It takes a number of
InstanceIterators for instances and exceptions and iterates all resulting instances
(i.e. only the instances, not the exceptions).-
Constructor Summary
ConstructorsConstructorDescriptionEffectiveInstancesIterator(InstanceIterator instances, InstanceIterator exceptions) Create a new recurrence iterator for specific lists of instances and exceptions. -
Method Summary
Modifier and TypeMethodDescriptionvoidfastForward(org.dmfs.rfc5545.DateTime until) Fast-forward to the next instance at or after the given date.booleanhasNext()Check if there is at least one more instance to iterate.org.dmfs.rfc5545.DateTimenext()Get the next instance of this set.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
EffectiveInstancesIterator
Create a new recurrence iterator for specific lists of instances and exceptions.- Parameters:
instances- The instances, must not benullor empty.exceptions- The exceptions, may be null.
-
-
Method Details
-
hasNext
public boolean hasNext()Check if there is at least one more instance to iterate. -
next
public org.dmfs.rfc5545.DateTime next()Get the next instance of this set. Do not call this ifhasNext()returnsfalse.- Specified by:
nextin interfaceIterator<org.dmfs.rfc5545.DateTime>- Returns:
- The time in milliseconds since the epoch of the next instance.
- Throws:
ArrayIndexOutOfBoundsException- if there are no more instances.
-
fastForward
public void fastForward(org.dmfs.rfc5545.DateTime until) Fast-forward to the next instance at or after the given date.- Specified by:
fastForwardin interfaceInstanceIterator
-