public static Function fillParas ( Function func , int ofs , Object [ ] paras ) { int i ; if ( func == null ) { throw new NullPointerException ( ) ; } for ( i = 0 ; i < paras . length ; i ++ ) { // ofs is not changed! func = Composition . create ( func , ofs , new Constant ( paras [ i ] . getClass ( ) , "arg" + i , paras [ i ] ) ) ; if ( func == null ) { throw new RuntimeException ( ) ; } } return func ; }
Replaces arguments to Functions by Constant Functions . Results in Functions with fewer arguments .