KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > simple > MyClass5b


1
2 package simple;
3
4 class MyClass5b extends MyClass5a
5 {
6     /*package*/ boolean factory;
7     private boolean preset;
8     private boolean postset;
9     private int value;
10     
11     private void preset() {
12         preset = true;
13         value = 1;
14     }
15     
16     private void postset() {
17         postset = true;
18         if (value == 2) {
19             value = 3;
20         }
21     }
22     
23     private void preget() {
24         value = 2;
25     }
26     
27     protected void verify() {
28         if (!factory || !preset || !postset) {
29             throw new IllegalStateException JavaDoc
30                 ("factory, pre-set, or post-set method not called");
31         }
32     }
33 }
34
Popular Tags