Add navigation links between time spans and transitions in TimeSpanMap
TimeSpanMap container provides duals views to its data.
Span view represent the time span during which one entry is valid, it has a value, and start and end dates.
Transition view represent one transition date between two spans.
Span view can be retrieved only for single dates, using
map.getSpan(date), it is not possible from a span to get naturally the previous or next span, one has to use dirty tricks like
map.getSpan(currentSpan.getStart().shiftedBy(-0.001)), hoping the previous span is larger than 1ms.
Transition view can be retrieved only globally as a
map.getTransitions(). There is
no way to get the
Span on each side, only the value contained in the
Transition views are therefore mutually exclusive at API level, despite they are intertwined in the implementation.
It would be nice to have a way to get the
Transition at start and end of a
Span, and to have the before and after
Spans at both sides of a
Transition. It would also be nice to have
previous methods to navigated from one
Transition to the other or to one
Span to the other.