public Segment nextSegment ( ) { if ( m_currentSegmentIndex != m_nextSegmentIndex ) _updateSegment ( ) ; if ( m_bCirculator ) { m_nextSegmentIndex = ( m_nextSegmentIndex + 1 ) % m_segmentCount ; } else { if ( m_nextSegmentIndex == m_segmentCount ) throw new IndexOutOfBoundsException ( ) ; m_nextSegmentIndex ++ ; } return m_currentSegment ; }
Moves the iterator to next segment and returns the segment .