Package threading

Examples of threading.SearchThread


    {
      queriesList.add(personComboBox.getSelectedItem().toString() +
          " " + "from: " + Integer.parseInt(fromYearTextBox.getText()) +
          " " + "to: " + Integer.parseInt(toYearTextBox.getText()) + ".");
     
      jobList.add(new SearchThread( (Person)(personComboBox.getSelectedItem()),
                      Integer.parseInt(fromYearTextBox.getText()),
                      Integer.parseInt(toYearTextBox.getText()))
      );
    }
    else if (e.getSource() == clearQueryButton)
View Full Code Here


   * @param y
   *            The year to search
   */
  public Person searchPerson(Person person, int low, int high)
  {
    SearchThread job = new SearchThread(person, low, high);
    IntegratorThread intergrator = new IntegratorThread();
    intergrator.incJob();
    pool.execute(job);
   
    try
    {
      pool.awaitTermination(10, TimeUnit.MILLISECONDS);
    }
    catch (InterruptedException e)
    {
      e.printStackTrace();
    }
   
    summaryArea.setText(job.getResult().lifeHistoryToString());

    return job.getResult();
  }
View Full Code Here

   *            The higher bound of the interval
   */
  public void searchListSearchByInterval(int low, int high)
  {
    Vector<MileStone> result = new Vector<MileStone>();
    SearchThread job;
    Person p;
   
    IntegratorThread integrator = new IntegratorThread();
    pool.execute(integrator);
   
    for (int i = 0 ; i < vipComboBox.getItemCount() ; i++)
    {
      p = vipComboBox.getItemAt(i);
      job = new SearchThread(p, low, high);
      job.addListener(integrator);
      integrator.incJob();
      pool.execute(job);
    }
   
    try
View Full Code Here

TOP

Related Classes of threading.SearchThread

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.