View Javadoc

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