removed unused private methods.
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / dom / LineComment.java
1 /*******************************************************************************
2  * Copyright (c) 2004, 2008 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.core.dom;
12
13 import java.util.ArrayList;
14 import java.util.List;
15
16 /**
17  * End-of-line comment AST node type.
18  * <p>
19  * End-of-line comments begin with "//",
20  * must end with a line delimiter (as per JLS 3.7),
21  * and must not contain line breaks.
22  * </p>
23  * <p>
24  * Note that this node type is a comment placeholder, and is
25  * only useful for recording the source range where a comment
26  * was found in a source string. It is not useful for creating
27  * comments.
28  * </p>
29  * 
30  * @since 3.0
31  * @noinstantiate This class is not intended to be instantiated by clients.
32  */
33 public final class LineComment extends Comment {
34         
35         /**
36          * A list of property descriptors (element type: 
37          * {@link StructuralPropertyDescriptor}),
38          * or null if uninitialized.
39          */
40         private static final List PROPERTY_DESCRIPTORS;
41         
42         static {
43                 List propertyList = new ArrayList(1);
44                 createPropertyList(LineComment.class, propertyList);
45                 PROPERTY_DESCRIPTORS = reapPropertyList(propertyList);
46         }
47
48         /**
49          * Returns a list of structural property descriptors for this node type.
50          * Clients must not modify the result.
51          * 
52          * @param apiLevel the API level; one of the
53          * <code>AST.JLS*</code> constants
54
55          * @return a list of property descriptors (element type: 
56          * {@link StructuralPropertyDescriptor})
57          * @since 3.0
58          */
59         public static List propertyDescriptors(int apiLevel) {
60                 return PROPERTY_DESCRIPTORS;
61         }
62                         
63         /**
64          * Creates a new line comment node owned by the given AST.
65          * <p>
66          * N.B. This constructor is package-private.
67          * </p>
68          * 
69          * @param ast the AST that is to own this node
70          */
71         LineComment(AST ast) {
72                 super(ast);
73         }
74
75         /* (omit javadoc for this method)
76          * Method declared on ASTNode.
77          */
78         final List internalStructuralPropertiesForType(int apiLevel) {
79                 return propertyDescriptors(apiLevel);
80         }
81         
82         /* (omit javadoc for this method)
83          * Method declared on ASTNode.
84          */
85         final int getNodeType0() {
86                 return LINE_COMMENT;
87         }
88
89         /* (omit javadoc for this method)
90          * Method declared on ASTNode.
91          */
92         ASTNode clone0(AST target) {
93                 LineComment result = new LineComment(target);
94                 result.setSourceRange(this.getStartPosition(), this.getLength());
95                 return result;
96         }
97
98         /* (omit javadoc for this method)
99          * Method declared on ASTNode.
100          */
101         final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
102                 // dispatch to correct overloaded match method
103                 return matcher.match(this, other);
104         }
105
106         /* (omit javadoc for this method)
107          * Method declared on ASTNode.
108          */
109         void accept0(ASTVisitor visitor) {
110                 visitor.visit(this);
111                 visitor.endVisit(this);
112         }
113         
114         /* (omit javadoc for this method)
115          * Method declared on ASTNode.
116          */
117         int memSize() {
118                 return super.memSize();
119         }
120         
121         /* (omit javadoc for this method)
122          * Method declared on ASTNode.
123          */
124         int treeSize() {
125                 return memSize();
126         }
127 }