01: /*
02: * Author: Mike Atkinson
03: *
04: * This software has been developed under the copyleft
05: * rules of the GNU General Public License. Please
06: * consult the GNU General Public License for more
07: * details about use and distribution of this software.
08: */
09: package net.sourceforge.jrefactory.ast;
10:
11: import net.sourceforge.jrefactory.parser.JavaParser;
12: import net.sourceforge.jrefactory.parser.JavaParserVisitor;
13:
14: /**
15: * Stores an if statement. This statement can contain an else, and that just depends on the number of children nodes to
16: * this statement.
17: *
18: * @author Mike Atkinson
19: * @since jRefactory 2.9.0, created October 16, 2003
20: */
21: public class ASTIfStatement extends SimpleNode {
22: private boolean hasElse;
23:
24: /**
25: * Constructor for the ASTIfStatement node.
26: *
27: * @param identifier The id of this node (JJTELSESTATEMENT).
28: */
29: public ASTIfStatement(int identifier) {
30: super (identifier);
31: }
32:
33: /**
34: * Constructor for the ASTIfStatement node.
35: *
36: * @param parser The JavaParser that created this ASTIfStatement node.
37: * @param identifier The id of this node (JJTELSESTATEMENT).
38: */
39: public ASTIfStatement(JavaParser parser, int identifier) {
40: super (parser, identifier);
41: }
42:
43: /** Sets the hasElse attribute of the ASTIfStatement node. */
44: public void setHasElse() {
45: this .hasElse = true;
46: }
47:
48: /**
49: * Description of the Method
50: *
51: * @return Description of the Returned Value
52: */
53: public boolean hasElse() {
54: return this .hasElse;
55: }
56:
57: /**
58: * Accept the visitor.
59: *
60: * @param visitor An implementation of JavaParserVisitor that processes the ASTIfStatement node.
61: * @param data Some data being passed between the visitor methods.
62: * @return Usually the data parameter (possibly modified).
63: */
64: public Object jjtAccept(JavaParserVisitor visitor, Object data) {
65: return visitor.visit(this, data);
66: }
67: }
|