public static int getFieldIndex ( Field [ ] fields , String name ) { // Linear search, assuming a small number of fields per table. for ( int i = 0 ; i < fields . length ; i ++ ) if ( fields [ i ] . name . equals ( name ) ) return i ; return - 1 ; }
Finds the index of the field given a string name .