KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.puppycrawl.tools.checkstyle;
2
3 /**
4  * Test file for covariant equals methods.
5  * @author Rick Giles
6  */

7 public class InputCovariant
8 {
9     private class Inner
10     {
11         public boolean equals(Inner aInner)
12         {
13             return false;
14         }
15     }
16
17     private class Inner2
18     {
19         public boolean equals(Inner2 aInner2)
20         {
21             return false;
22         }
23         
24         public boolean equals(Object JavaDoc aObj)
25         {
26             return false;
27         }
28     }
29
30     public boolean equals(InputCovariant aInputCovariant)
31     {
32         return false;
33     }
34 }
35
36 class InputCovariant2
37 {
38     public boolean equals(InputCovariant2 aInputCovariant2)
39     {
40         return false;
41     }
42     
43     public boolean equals(Object JavaDoc aObject)
44     {
45         return false;
46     }
47 }
48
49 class InputCovariant3
50 {
51     public boolean equals(InputCovariant3 aInputCovariant3)
52     {
53         return false;
54     }
55     
56     public boolean equals(java.lang.Object JavaDoc aObject)
57     {
58         return false;
59     }
60 }
61
62 class InputCovariant4
63 {
64     public boolean equals(int i)
65     {
66         return false;
67     }
68 }
69
70 class Anonymous
71 {
72     Comparable JavaDoc comp = new Comparable JavaDoc()
73         {
74             public int compareTo(Object JavaDoc aObject)
75             {
76                 return 0;
77             }
78             public boolean equals(String JavaDoc aString)
79             {
80                 return false;
81             }
82         };
83     
84     public boolean equals(Object JavaDoc aObject)
85     {
86         return false;
87     }
88     
89     public void method()
90     {
91         Double JavaDoc d = new Double JavaDoc(1);
92     }
93 }
94
95 abstract class InputCovariant5
96 {
97     public abstract boolean equals(InputCovariant4 aInputCovariant4);
98 }
99
100 interface InputCovariant6
101 {
102     public boolean equals(InputCovariant5 aInputCovariant5);
103 }
104
105 class InputGenericCovariant7
106 {
107     public <A> boolean equals(InputGenericCovariant7 aInputCovariant7)
108     {
109         return true;
110     }
111
112     public <A> boolean equals(Object JavaDoc aObject)
113     {
114         return false;
115     }
116 }
117
118 class InputGenericCovariant8
119 {
120     public <A> boolean equals(InputGenericCovariant8 aInputCovariant8)
121     {
122         return true;
123     }
124
125     public boolean equals(Object JavaDoc aObject)
126     {
127         return false;
128     }
129 }
Popular Tags