private String [ ] selectColumnNames ( List < String > names , ColumnType [ ] types ) { List < String > header = new ArrayList <> ( ) ; for ( int i = 0 ; i < types . length ; i ++ ) { if ( types [ i ] != SKIP ) { String name = names . get ( i ) ; name = name . trim ( ) ; header . add ( name ) ; } } String [ ] result = new String [ header . size ( ) ] ; return header . toArray ( result ) ; }
Reads column names from header skipping any for which the type == SKIP