forked from DrJavaAtRice/drjava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVarargArrayType.java
More file actions
89 lines (76 loc) · 2.52 KB
/
Copy pathVarargArrayType.java
File metadata and controls
89 lines (76 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package edu.rice.cs.drjava.model.repl.types;
import edu.rice.cs.drjava.model.repl.newjvm.*;
/**
* Class VarargArrayType, a component of the ASTGen-generated composite hierarchy.
* Note: null is not allowed as a value for any field.
* @version Generated automatically by ASTGen at Thu Oct 16 08:57:12 CDT 2014
*/
//@SuppressWarnings("unused")
public class VarargArrayType extends ArrayType {
/**
* Constructs a VarargArrayType.
* @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
*/
public VarargArrayType(Type in_ofType) {
super(in_ofType);
}
public <RetType> RetType apply(TypeVisitor<RetType> visitor) {
return visitor.forVarargArrayType(this);
}
public void apply(TypeVisitor_void visitor) {
visitor.forVarargArrayType(this);
}
/**
* Implementation of toString that uses
* {@link #output} to generate a nicely tabbed tree.
*/
public java.lang.String toString() {
java.io.StringWriter w = new java.io.StringWriter();
walk(new ToStringWalker(w, 2));
return w.toString();
}
/**
* Prints this object out as a nicely tabbed tree.
*/
public void output(java.io.Writer writer) {
walk(new ToStringWalker(writer, 2));
}
/**
* Implementation of equals that is based on the values of the fields of the
* object. Thus, two objects created with identical parameters will be equal.
*/
public boolean equals(java.lang.Object obj) {
if (obj == null) return false;
if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
return false;
}
else {
VarargArrayType casted = (VarargArrayType) obj;
Type temp_ofType = ofType();
Type casted_ofType = casted.ofType();
if (!(temp_ofType == casted_ofType || temp_ofType.equals(casted_ofType))) return false;
return true;
}
}
/**
* Implementation of hashCode that is consistent with equals. The value of
* the hashCode is formed by XORing the hashcode of the class object with
* the hashcodes of all the fields of the object.
*/
public int generateHashCode() {
int code = getClass().hashCode();
Type temp_ofType = ofType();
code ^= temp_ofType.hashCode();
return code;
}
public void walk(TreeWalker w) {
if (w.visitNode(this, "VarargArrayType", 1)) {
Type temp_ofType = ofType();
if (w.visitNodeField("ofType", temp_ofType)) {
temp_ofType.walk(w);
w.endNodeField("ofType", temp_ofType);
}
w.endNode(this, "VarargArrayType", 1);
}
}
}