public static FeatureList read ( String filename ) throws IOException { logger . info ( "Reading: {}" , filename ) ; FeatureList features = new FeatureList ( ) ; BufferedReader br = new BufferedReader ( new FileReader ( filename ) ) ; String s ; for ( s = br . readLine ( ) ; null != s ; s = br . readLine ( ) ) { s = s . trim ( ) ; if ( s . length ( ) > 0 ) { if ( s . charAt ( 0 ) == ' ' ) { //ignore comment lines } else { FeatureI f = parseLine ( s ) ; if ( f != null ) { features . add ( f ) ; } } } } br . close ( ) ; return features ; }
Read a file into a FeatureList . Each line of the file becomes one Feature object .