KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nfunk > jepexamples > ThreadTestThread


1 /*****************************************************************************
2
3 JEP - Java Math Expression Parser 2.3.0
4       October 3 2004
5       (c) Copyright 2004, Nathan Funk and Richard Morris
6       See LICENSE.txt for license information.
7
8 *****************************************************************************/

9
10 package org.nfunk.jepexamples;
11
12
13 /**
14  * The ThreadTestThread waits for 1 second before calling the evaluate method
15  * of the ThreadTest instance.
16  * <p>
17  * Thanks to Matthew Baird and Daniel Teng for this code.
18  */

19 public class ThreadTestThread extends Thread JavaDoc
20 {
21     ThreadTest test;
22
23     public ThreadTestThread(ThreadTest test_in)
24     {
25         test = test_in;
26     }
27
28     public void run() {
29         try {
30             Thread.sleep(1);
31             test.evaluate();
32             Thread.yield();
33         } catch (Exception JavaDoc e) {
34             System.out.println(e.getMessage());
35         }
36     }
37 }
38
Popular Tags