KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > tests > jfun > yan > testmodel > CarEngine


1 /*
2  * Created on Mar 16, 2005
3  *
4  * Author Ben Yu
5  * ZBS
6  */

7 package tests.jfun.yan.testmodel;
8
9 /**
10  * Zephyr Business Solution
11  *
12  * @author Ben Yu
13  *
14  */

15 public class CarEngine implements Engine {
16   private int started = 0;
17   private int stopped = 0;
18   private int init = 0;
19   private int disposed = 0;
20   public void start() {
21     started++;
22   }
23   public void stop() {
24     stopped++;
25   }
26   
27   public void destroy() {
28     disposed++;
29   }
30   public void initialize() {
31     init++;
32   }
33   public int getStarted() {
34     return started;
35   }
36   public int getStopped() {
37     return stopped;
38   }
39   
40   public int getDisposed() {
41     return disposed;
42   }
43   public int getInit() {
44     return init;
45   }
46   public boolean isInitialized(){
47     return init>0;
48   }
49   public boolean isDestroyed(){
50     return disposed > 0;
51   }
52   public boolean isStarted(){
53     return started>0;
54   }
55   public boolean isStopped(){
56     return stopped > 0;
57   }
58 }
59
Popular Tags