July 2018
Intermediate to advanced
242 pages
8h 6m
English
In order to accomplish the task, we need to start by getting familiar with the ClosedRange and Iterator interfaces. We need to use them to declare a custom progression for the LocalDate class:
public interface ClosedRange<T: Comparable<T>> { public val start: T public val endInclusive: T public operator fun contains(value: T): Boolean { return value >= start && value <= endInclusive } public fun isEmpty(): Boolean = start > endInclusive}
The Iterator interface provides information about the subsequent values and their availability:
public interface Iterator<out T> { public operator fun next(): T public operator fun hasNext(): Boolean}
The ClosedRange interface provides the minimum and maximum values of the range. It also provides ...
Read now
Unlock full access