@ SuppressWarnings ( "checkstyle:nestedifdepth" ) protected final List < GraphIterationElement < ST , PT > > getNextSegments ( boolean avoid_visited_segments , GraphIterationElement < ST , PT > element ) { assert this . allowManyReplies || this . visited != null ; if ( element != null ) { final ST segment = element . getSegment ( ) ; final PT point = element . getPoint ( ) ; if ( ( segment != null ) && ( point != null ) ) { final PT pts = segment . getOtherSidePoint ( point ) ; if ( pts != null ) { final double distanceToReach = element . getDistanceToReachSegment ( ) + segment . getLength ( ) ; GraphIterationElement < ST , PT > candidate ; final double restToConsume = element . distanceToConsume - segment . getLength ( ) ; final List < GraphIterationElement < ST , PT > > list = new ArrayList <> ( ) ; for ( final ST theSegment : pts . getConnectedSegmentsStartingFrom ( segment ) ) { if ( ! theSegment . equals ( segment ) ) { candidate = newIterationElement ( segment , theSegment , pts , distanceToReach , restToConsume ) ; if ( ( this . allowManyReplies ) || ( ! avoid_visited_segments ) || ( ! this . visited . contains ( candidate ) ) ) { list . add ( candidate ) ; } } } return list ; } } } throw new NoSuchElementException ( ) ; }
Replies the next segments .