swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] A Query


From: Kavita Gangal
Subject: Re: [Swarm-Support] A Query
Date: Wed, 20 Jun 2007 13:21:02 +0530


Hello,

Sorry for the delayed reply,
I'll explain the problem in detail.

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.

--

Thanks and Regards,
Kavita Gangal
--
TIFR



On 6/13/07, Paul Johnson <address@hidden> wrote:
Kavita Gangal wrote:
> Hello everyone,
>
> I need to know how to pass methods with arguments in the Selector.
>
>
It would help me if you explain what you are trying to do.

In building actions, the arguments must be objects, and then you can use
syntax like like  M(someMethod:):anObject

if you are meaning to use method "someMethod:" with argument anObject.

pj

--
Paul E. Johnson                       email: address@hidden
Professor, Political Science          http://pj.freefaculty.org
1541 Lilac Lane, Rm 504
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700

_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support





reply via email to

[Prev in Thread] Current Thread [Next in Thread]