I have defined a method which takes in 2 objects as arguments. Using
the buildObjects method of the swarmImpl class i have built and
populated a List of objects personList which extends ListImpl.
I have written a class named "person" in which i have a method
called "statisticsPerson()" which takes in two parameters. One is the
"personList" object built by the buildObjects method. the second is
integer value "i".
Now, in the SwarmImpl class there is a method known as buildActions(). Using
this method i need to pass the method "statisticsPerson()" to all the
objects in the list "personList". for that i am using an object of
class "Selector"
whose constructor takes in three parameters. Second parameter is the
name of the Method you want to execute, First parameter is the class
which contains that Method and Third parameter is a boolean value
whether the class is ObjectiveC type. This third parameter i had set to
False.
Then, with the help of the createActionForEach$message()
method from the swarmImpl class this method is executed on all the
objects in "personList".
Now, while passing the second parameter
(i.e. the method name) for the constructor of the "Selector" class you
can't pass the parameters for that method.
i.e. the following syntax is valid: sel1 = new Selector(Class.forName("sampleswarmpack.person"), "statisticsPerson" , false); and the following syntax is INVALID: sel1 = new Selector(Class.forName
("sampleswarmpack.person"), "statisticsPerson( personList , i )" , false); I need to know how i can pass the parameters to the method statisticsPerson() from the "Selector" class.