KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > junitx > example > PrivateAccessorExample


1 package junitx.example;
2
3 /**
4  * @version $Revision: 1.3 $ $Date: 2003/01/20 10:44:49 $
5  * @author <a HREF="mailto:vbossica@users.sourceforge.net">Vladimir R. Bossicard</a>
6  */

7 public class PrivateAccessorExample {
8
9     private int intvalue;
10     protected Boolean JavaDoc boolvalue;
11     private static double doublevalue;
12
13     /* so that PMD doesn't complain anymore */
14     public void dummyPMD() {
15         getIntValue();
16         setIntValue(2);
17     }
18
19     private int getIntValue() {
20         return this.intvalue;
21     }
22
23     private void setIntValue(int value) {
24         this.intvalue = value;
25     }
26
27     protected Boolean JavaDoc getBoolValue() {
28         return this.boolvalue;
29     }
30
31     protected void setBoolValue(Boolean JavaDoc value) {
32         this.boolvalue = value;
33     }
34
35     private static void setDoubleValue(double value) {
36         doublevalue = value;
37     }
38
39     private static double getDoubleValue() {
40         return doublevalue;
41     }
42
43 }
44
Popular Tags