protected boolean parseLineInternal ( ) { // Split into numerical attributes and labels int i = 0 ; for ( /* initialized by nextLineExceptComents()! */ ; tokenizer . valid ( ) ; tokenizer . advance ( ) , i ++ ) { if ( ! isLabelColumn ( i ) && ! tokenizer . isQuoted ( ) ) { try { attributes . add ( tokenizer . getDouble ( ) ) ; continue ; } catch ( NumberFormatException e ) { if ( ! warnedPrecision && ( e == ParseUtil . PRECISION_OVERFLOW || e == ParseUtil . EXPONENT_OVERFLOW ) ) { getLogger ( ) . warning ( "Too many digits in what looked like a double number - treating as string: " + tokenizer . getSubstring ( ) ) ; warnedPrecision = true ; } // Ignore attempt, add to labels below. } } // Else: labels. String lbl = tokenizer . getStrippedSubstring ( ) ; if ( lbl . length ( ) > 0 ) { haslabels = true ; lbl = unique . addOrGet ( lbl ) ; labels . add ( lbl ) ; } } // Maybe a label row? if ( curvec == null && attributes . size == 0 ) { columnnames = new ArrayList <> ( labels ) ; haslabels = false ; curvec = null ; curlbl = null ; labels . clear ( ) ; return false ; } // Pass outside via class variables curvec = createVector ( ) ; curlbl = LabelList . make ( labels ) ; attributes . clear ( ) ; labels . clear ( ) ; return true ; }
Internal method for parsing a single line . Used by both line based parsing as well as block parsing . This saves the building of meta data for each line .