|
1 |
| package edu.rice.cs.javalanglevels.tree; |
|
2 |
| |
|
3 |
| import edu.rice.cs.javalanglevels.SourceInfo; |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| public class SimpleAnonymousClassInstantiation extends AnonymousClassInstantiation { |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
11
| public SimpleAnonymousClassInstantiation(SourceInfo in_sourceInfo, Type in_type, ParenthesizedExpressionList in_arguments, BracedBody in_body) {
|
|
17 |
11
| super(in_sourceInfo, in_type, in_arguments, in_body);
|
|
18 |
| } |
|
19 |
| |
|
20 |
| |
|
21 |
17
| public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor) { return visitor.forSimpleAnonymousClassInstantiation(this); }
|
|
22 |
0
| public void visit(JExpressionIFVisitor_void visitor) { visitor.forSimpleAnonymousClassInstantiation(this); }
|
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
0
| public java.lang.String toString() {
|
|
29 |
0
| java.io.StringWriter w = new java.io.StringWriter();
|
|
30 |
0
| output(w);
|
|
31 |
0
| return w.toString();
|
|
32 |
| } |
|
33 |
| |
|
34 |
| |
|
35 |
| |
|
36 |
| |
|
37 |
0
| public void output(java.io.Writer writer) {
|
|
38 |
0
| outputHelp(new TabPrintWriter(writer, 2));
|
|
39 |
| } |
|
40 |
| |
|
41 |
0
| public void outputHelp(TabPrintWriter writer) {
|
|
42 |
0
| writer.print("SimpleAnonymousClassInstantiation" + ":");
|
|
43 |
0
| writer.indent();
|
|
44 |
| |
|
45 |
0
| writer.startLine("");
|
|
46 |
0
| writer.print("sourceInfo = ");
|
|
47 |
0
| SourceInfo temp_sourceInfo = getSourceInfo();
|
|
48 |
0
| if (temp_sourceInfo == null) {
|
|
49 |
0
| writer.print("null");
|
|
50 |
| } else { |
|
51 |
0
| writer.print(temp_sourceInfo);
|
|
52 |
| } |
|
53 |
| |
|
54 |
0
| writer.startLine("");
|
|
55 |
0
| writer.print("type = ");
|
|
56 |
0
| Type temp_type = getType();
|
|
57 |
0
| if (temp_type == null) {
|
|
58 |
0
| writer.print("null");
|
|
59 |
| } else { |
|
60 |
0
| temp_type.outputHelp(writer);
|
|
61 |
| } |
|
62 |
| |
|
63 |
0
| writer.startLine("");
|
|
64 |
0
| writer.print("arguments = ");
|
|
65 |
0
| ParenthesizedExpressionList temp_arguments = getArguments();
|
|
66 |
0
| if (temp_arguments == null) {
|
|
67 |
0
| writer.print("null");
|
|
68 |
| } else { |
|
69 |
0
| temp_arguments.outputHelp(writer);
|
|
70 |
| } |
|
71 |
| |
|
72 |
0
| writer.startLine("");
|
|
73 |
0
| writer.print("body = ");
|
|
74 |
0
| BracedBody temp_body = getBody();
|
|
75 |
0
| if (temp_body == null) {
|
|
76 |
0
| writer.print("null");
|
|
77 |
| } else { |
|
78 |
0
| temp_body.outputHelp(writer);
|
|
79 |
| } |
|
80 |
0
| writer.unindent();
|
|
81 |
| } |
|
82 |
| |
|
83 |
| |
|
84 |
| |
|
85 |
| |
|
86 |
| |
|
87 |
| |
|
88 |
0
| public boolean equals(java.lang.Object obj) {
|
|
89 |
0
| if (obj == null) return false;
|
|
90 |
0
| if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
|
|
91 |
0
| return false;
|
|
92 |
| } else { |
|
93 |
0
| SimpleAnonymousClassInstantiation casted = (SimpleAnonymousClassInstantiation) obj;
|
|
94 |
0
| if (! (getType().equals(casted.getType()))) return false;
|
|
95 |
0
| if (! (getArguments().equals(casted.getArguments()))) return false;
|
|
96 |
0
| if (! (getBody().equals(casted.getBody()))) return false;
|
|
97 |
0
| return true;
|
|
98 |
| } |
|
99 |
| } |
|
100 |
| |
|
101 |
| |
|
102 |
| |
|
103 |
| |
|
104 |
| |
|
105 |
| |
|
106 |
| |
|
107 |
0
| protected int generateHashCode() {
|
|
108 |
0
| int code = getClass().hashCode();
|
|
109 |
0
| code ^= 0;
|
|
110 |
0
| code ^= getType().hashCode();
|
|
111 |
0
| code ^= getArguments().hashCode();
|
|
112 |
0
| code ^= getBody().hashCode();
|
|
113 |
0
| return code;
|
|
114 |
| } |
|
115 |
| } |