Add getFirstNonNullSpan and getLastNonNullSpan to TimeSpanMap
It is possible to get the first and last Span
in a TimeSpanMap
.
However, one classical use case for TimeSpanMap
is to build it first with a null
object covering the full time range from past infinity to future infinity, and then to add one or several objects with limited time ranges. In this case, the first and last span are not meaningful because they correspond to the out of range parts that extends to infinity.
It would be more user-friendly to be able to retrieve directly the first and last spans that have non-null data. Of course, an exception should be thrown if all spans have null data.