java - Dynamic amount of loops through permutations -
I have found a program that will dynamically reach different approaches and in each method different quantities of parameters Will be I need to find a way to index these criteria through thousands of different arrangements, and I'm not sure how the loop dynamically through these permutations.
For example, for a function with two parameters, I can repeat through the order in such a way:
public static zero main (string [] args) {List & lt; Object [] & gt; Params = new arrelist (); Params.add (new integer [] (1,2,3}); Params.add (new Boolean [] (wrong, true)) runCalculation ("function1", parameter);} Public Zero run cloluation (string function name, List; Object for: parameters.get (0)) {for (object j: parameters.get (1)) {// Do reflection function call with (i, j) as parameter }}} But if I had the next function, I want to use 3 parameters, it is now again through all permutations O Will I be able to use a dynamic amount of loops to process the list correctly array parameter values do? I think that this is the only way to implement something like this, but I am still struggling to think about its correct solution which will allow the dynamic quantity of parameters for each function properly, and then these standards There will be different types for
public void runCalculation (string function name, list & gt; object & gt; parameter) { For calling (list & lt; Object & gt; list: parameters) {// Reflection function with OBJ as call parameter}}} it is called, to use it Also try - it's easy to use and has very little overhead
Comments
Post a Comment