Hello. I'm new in OOP so this might have an easy answer.
I have an abstract class with a lot of functionality. The functionality I'm interested in are 2 methods.
One public object getF(object) that takes an array of objects, simulates all of them multithreaded and returns the same array objects with the results in their properties.
And one other public object getF(object) that takes only one object of the same type, makes it an array and send it to the first method. It also returns the same object with the result.
I have 2 inherited classes of the abstract class. The first takes some properties, builds an object of the 2nd class and gets the results from it.
The 2nd class is an optimization algorithm which builds an object and sends it to the getF(object) method of the abstract class. Takes back the result, calculates the next one etc until it finishes and sends the result to the 1st class.
What I want to do is to build in the 1st class (or a new one) that builds more than one objects of the 2nd class. When I do this, every object of the 2nd class simulates onethreaded because every one of them calls getF(object). I want them to call a getF method which waits until it gets object from every 2nd class object and then send them to getF(object) for multithreaded operation. When it finishes it should return the results to the correct 2nd class object.
How can I do this?