/Users/lyon/j4p/src/bookExamples/ch13Threads/fsm/TglClkTest.java

1    /** 
2     * Created by IntelliJ IDEA. 
3     * User: dlyon 
4     * Date: Feb 4, 2004 
5     * Time: 4:44:53 PM 
6     * To change this template use Options | File Templates. 
7     */ 
8    package bookExamples.ch13Threads.fsm; 
9     
10   import java.util.Observer; 
11   import java.util.Observable; 
12    
13   public class TglClkTest implements Observer { 
14       private ToggleFF tt = new ToggleFF(); 
15       private ObservableClock oc = new ObservableClock(1000); 
16    
17       public TglClkTest() { 
18           oc.addObserver(this); 
19       } 
20    
21       public static void main(String args[]) { 
22           TglClkTest tct = new TglClkTest(); 
23       } 
24    
25       public void update(Observable obs, Object obj) { 
26           boolean input [] = {true}; 
27           tt.f(input); 
28           System.out.println(tt); 
29       } 
30   } 
31