Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

threads from existing classes

Options
  • 17-10-2003 11:42am
    #1
    Registered Users Posts: 7,580 ✭✭✭


    I'm working on my 4th yr project @ the mo.
    I have a package which has a series of classes to query Search Engines and parse the results. I have a group of classes in which each class uses this first package to query a specific search engine. They all use a common excel file to get the queries. The results of this is that running "SearchGoogle" I can get the first 500 results for x number of queries(depending on the excel file).

    Given I have these classes in place designed to run seperately, is possible/easy to create a controlling class that i can run to simulataneously run these 5 "Search'insertenginehere' " classes? They all use the same query file and store to different places.

    Everything i've read/can find only shows how to create threads from the ground up...
    My ultimate ambition is to be able to get the program to automatically query the engines using different query files every day of the week, although the error potential of this is probably huge. Any help or pointers appreciated.



    [edit]this is all in java btw


Comments

  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Do your own homework ya bum! :p

    If you write a virtual class for the classes which query the search engines, then you can have a private Thread subclass internal in that virtual class which is inherited by each subclass called "Search(InsertNameHere)".

    So for SearchGoogle for example, you just call the SearchGoogle.beginSearch() method to start the thread.

    Or you could have a look at last years project, and what I did with an interface and having an array of implementations of the interface, each of which I just loaded into a Thread subclass and started running.

    :)


  • Registered Users Posts: 7,580 ✭✭✭uberwolf


    I knew you'd respond!! Little harder than last year, when i could just turn around to find you!!

    Think I might just be lazy though and run them concurrently through diff cmd windows, let windows do my threading :P


  • Registered Users Posts: 68,317 ✭✭✭✭seamus


    Now you're just being ridiculous..... :p

    What if you wanted to run it in Linux.....?

    PM me


Advertisement