1 /* Generated By:JJTree: Do not edit this line. ASTType.java */
2
3 package net.sourceforge.pmd.ast;
4
5 public class ASTType extends SimpleNode {
6 public ASTType(int id) {
7 super(id);
8 }
9
10 public ASTType(JavaParser p, int id) {
11 super(p, id);
12 }
13
14 private boolean isArray;
15 private int dimensions;
16
17 public boolean isArray() {
18 return this.isArray;
19 }
20
21 public void setIsArray() {
22 this.isArray = true;
23 }
24
25 public void addDimension() {
26 dimensions++;
27 }
28
29 /***
30 * Note that this is only valid for array types. It'd
31 * be better to have a ASTType subclass for this.
32 */
33 public int getDimensions() {
34 return dimensions;
35 }
36
37 /*** Accept the visitor. **/
38 public Object jjtAccept(JavaParserVisitor visitor, Object data) {
39 return visitor.visit(this, data);
40 }
41
42 public void dump(String prefix) {
43 String out = toString(prefix) + ":";
44 if (isArray()) {
45 out += "(array";
46 for (int i=0;i<getDimensions();i++) {
47 out += "[";
48 }
49 out += ")";
50 }
51 System.out.println(out);
52 dumpChildren(prefix);
53 }
54
55 }
This page was automatically generated by Maven