View Javadoc

1   /**
2    * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3    */
4   /* Generated By:JJTree: Do not edit this line. ASTPrimarySuffix.java */
5   
6   package net.sourceforge.pmd.lang.java.ast;
7   
8   public class ASTPrimarySuffix extends AbstractJavaNode {
9       public ASTPrimarySuffix(int id) {
10          super(id);
11      }
12  
13      public ASTPrimarySuffix(JavaParser p, int id) {
14          super(p, id);
15      }
16  
17      private boolean isArguments;
18      private boolean isArrayDereference;
19  
20      public void setIsArrayDereference() {
21          isArrayDereference = true;
22      }
23  
24      public boolean isArrayDereference() {
25          return isArrayDereference;
26      }
27  
28      public void setIsArguments() {
29          this.isArguments = true;
30      }
31  
32      public boolean isArguments() {
33          return this.isArguments;
34      }
35  
36      /**
37       * Get the number of arguments for this primary suffix.  One should call
38       * {@link #isArguments()} to see if there are arguments.  If this method is
39       * called when there are no arguments it returns <code>-1</code>.
40       * @return A non-negative argument number when there are arguments,
41       * <code>-1</code> otherwise.
42       */
43      public int getArgumentCount() {
44          if (!this.isArguments()) {
45              return -1;
46          }
47          return ((ASTArguments)jjtGetChild(jjtGetNumChildren()-1)).getArgumentCount();
48      }
49  
50      /**
51       * Accept the visitor. *
52       */
53      @Override
54      public Object jjtAccept(JavaParserVisitor visitor, Object data) {
55          return visitor.visit(this, data);
56      }
57  }