KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > InputFinalClass


1 ////////////////////////////////////////////////////////////////////////////////
2
// Test case file for checkstyle.
3
// Created: 2003
4
////////////////////////////////////////////////////////////////////////////////
5
package com.puppycrawl.tools.checkstyle;
6
7 public class InputFinalClass
8 {
9     private InputFinalClass() {}
10 }
11
12 class test2 {}
13 class test3
14 {
15    class test4
16    {
17        private test4() {}
18    }
19 }
20
21 class test5
22 {
23     private test5() {}
24     test5(int i) {}
25 }
26
27 class test6
28 {
29     public test6() {}
30 }
31
32 // Typesafe enum with operation
33
// abstract classes cannot be final, see bug #837012
34
abstract class Operation
35 {
36     abstract double eval(double a, double b);
37     
38     public static final Operation PLUS =
39     new Operation("+")
40     {
41         double eval(double a, double b)
42         {
43         return a + b;
44         }
45     };
46     
47     public static final Operation MINUS =
48     new Operation("-")
49     {
50         double eval(double a, double b)
51         {
52         return a - b;
53         }
54     };
55     
56     private String JavaDoc _name;
57     private Operation(String JavaDoc name)
58     {
59     this._name = name;
60     }
61 }
62
63 // Typesafe enum with operation
64
// abstract classes cannot be final, see bug #837012
65
interface Evaluatable
66 {
67     double eval(double a, double b);
68 }
69
70 // abstract class without it's own abstract method decl
71
abstract class Operation2 implements Evaluatable
72 {
73     
74     public static final Operation2 PLUS =
75     new Operation2("+")
76     {
77         public double eval(double a, double b)
78         {
79         return a + b;
80         }
81     };
82     
83     public static final Operation2 MINUS =
84     new Operation2("-")
85     {
86         public double eval(double a, double b)
87         {
88         return a - b;
89         }
90     };
91     
92     private String JavaDoc _name;
93     private Operation2(String JavaDoc name)
94     {
95     this._name = name;
96     }
97 }
98
99 enum testenum1
100 {
101     A, B;
102     testenum1() {}
103 }
104
105 enum testenum2
106 {
107     A, B;
108
109     public static class someinnerClass
110     {
111         private someinnerClass() {}
112     }
113 }
114
Popular Tags