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 java.util.Arrays;
12: import java.util.Comparator;
13: import net.sourceforge.jrefactory.parser.JavaParser;
14: import net.sourceforge.jrefactory.parser.JavaParserVisitor;
15:
16: /**
17: * Contains a list of names contained in the children, for instance for the interfaces that a class implements.
18: *
19: * @author Mike Atkinson
20: * @since jRefactory 2.9.0, created October 16, 2003
21: */
22: public class ASTNameList extends SimpleNode {
23: /**
24: * Constructor for the ASTNameList node.
25: *
26: * @param identifier The id of this node (JJTNAMELIST).
27: */
28: public ASTNameList(int identifier) {
29: super (identifier);
30: }
31:
32: /**
33: * Constructor for the ASTNameList node.
34: *
35: * @param parser The JavaParser that created this ASTNameList node.
36: * @param identifier The id of this node (JJTNAMELIST).
37: */
38: public ASTNameList(JavaParser parser, int identifier) {
39: super (parser, identifier);
40: }
41:
42: /**
43: * Sorts the arrays
44: *
45: * @param order the order of items
46: */
47: public void sort(Comparator order) {
48: if (children != null) {
49: Arrays.sort(children, order);
50: }
51: }
52:
53: /**
54: * Accept the visitor.
55: *
56: * @param visitor An implementation of JavaParserVisitor that processes the ASTNameList node.
57: * @param data Some data being passed between the visitor methods.
58: * @return Usually the data parameter (possibly modified).
59: */
60: public Object jjtAccept(JavaParserVisitor visitor, Object data) {
61: return visitor.visit(this, data);
62: }
63: }
|