private static ColumnInfo [ ] prependColumn ( ColumnInfo firstColumn , ColumnInfo [ ] columns ) { int allLen = 1 + columns . length ; ColumnInfo [ ] allColumns = new ColumnInfo [ allLen ] ; allColumns [ 0 ] = firstColumn ; for ( int i = 0 ; i < columns . length ; i ++ ) { allColumns [ i + 1 ] = columns [ i ] ; } return allColumns ; }
Given a column and an array of columns return a new array of columns with the single guy prepended onto the others . This function is used in the constructor below so that one constructor can call another without breaking Java rules about chained constructors being the first thing called .