|
1 |
| package edu.rice.cs.javalanglevels.tree; |
|
2 |
| |
|
3 |
| import edu.rice.cs.javalanglevels.SourceInfo; |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| public class SimpleNamedClassInstantiation extends NamedClassInstantiation { |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
80
| public SimpleNamedClassInstantiation(SourceInfo in_sourceInfo, Type in_type, ParenthesizedExpressionList in_arguments) {
|
|
17 |
80
| super(in_sourceInfo, in_type, in_arguments);
|
|
18 |
| } |
|
19 |
| |
|
20 |
| |
|
21 |
141
| public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor) { return visitor.forSimpleNamedClassInstantiation(this); }
|
|
22 |
0
| public void visit(JExpressionIFVisitor_void visitor) { visitor.forSimpleNamedClassInstantiation(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 |
40
| public void outputHelp(TabPrintWriter writer) {
|
|
42 |
40
| writer.print("SimpleNamedClassInstantiation" + ":");
|
|
43 |
40
| writer.indent();
|
|
44 |
| |
|
45 |
40
| writer.startLine("");
|
|
46 |
40
| writer.print("sourceInfo = ");
|
|
47 |
40
| SourceInfo temp_sourceInfo = getSourceInfo();
|
|
48 |
40
| if (temp_sourceInfo == null) {
|
|
49 |
0
| writer.print("null");
|
|
50 |
| } else { |
|
51 |
40
| writer.print(temp_sourceInfo);
|
|
52 |
| } |
|
53 |
| |
|
54 |
40
| writer.startLine("");
|
|
55 |
40
| writer.print("type = ");
|
|
56 |
40
| Type temp_type = getType();
|
|
57 |
40
| if (temp_type == null) {
|
|
58 |
0
| writer.print("null");
|
|
59 |
| } else { |
|
60 |
40
| temp_type.outputHelp(writer);
|
|
61 |
| } |
|
62 |
| |
|
63 |
40
| writer.startLine("");
|
|
64 |
40
| writer.print("arguments = ");
|
|
65 |
40
| ParenthesizedExpressionList temp_arguments = getArguments();
|
|
66 |
40
| if (temp_arguments == null) {
|
|
67 |
0
| writer.print("null");
|
|
68 |
| } else { |
|
69 |
40
| temp_arguments.outputHelp(writer);
|
|
70 |
| } |
|
71 |
40
| writer.unindent();
|
|
72 |
| } |
|
73 |
| |
|
74 |
| |
|
75 |
| |
|
76 |
| |
|
77 |
| |
|
78 |
| |
|
79 |
5
| public boolean equals(java.lang.Object obj) {
|
|
80 |
0
| if (obj == null) return false;
|
|
81 |
5
| if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
|
|
82 |
0
| return false;
|
|
83 |
| } else { |
|
84 |
5
| SimpleNamedClassInstantiation casted = (SimpleNamedClassInstantiation) obj;
|
|
85 |
0
| if (! (getType().equals(casted.getType()))) return false;
|
|
86 |
0
| if (! (getArguments().equals(casted.getArguments()))) return false;
|
|
87 |
5
| return true;
|
|
88 |
| } |
|
89 |
| } |
|
90 |
| |
|
91 |
| |
|
92 |
| |
|
93 |
| |
|
94 |
| |
|
95 |
| |
|
96 |
| |
|
97 |
4
| protected int generateHashCode() {
|
|
98 |
4
| int code = getClass().hashCode();
|
|
99 |
4
| code ^= 0;
|
|
100 |
4
| code ^= getType().hashCode();
|
|
101 |
4
| code ^= getArguments().hashCode();
|
|
102 |
4
| return code;
|
|
103 |
| } |
|
104 |
| } |