public void endInterval ( int lastIndex ) { if ( isOpen ) { currentDetail . setLast ( lastIndex ) ; pathDetails . add ( currentDetail ) ; } isOpen = false ; }
Ending intervals multiple times is safe we only write the interval if it was open and not empty . Writes the interval to the pathDetails