new version with WorkingCopy Management
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / core / jdom / IDOMCompilationUnit.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.core.jdom;
12
13 /**
14  * Represents a Java compilation unit (<code>.java</code> source file). 
15  * The corresponding syntactic unit is CompilationUnit (JLS2 7.3).  
16  * Allowable child types for a compilation unit are <code>IDOMPackage</code>, <code>IDOMImport</code>,
17  * and <code>IDOMType</code>.
18  * <p>
19  * This interface is not intended to be implemented by clients.
20  * </p>
21  */
22 public interface IDOMCompilationUnit extends IDOMNode {
23 /**
24  * Returns the header comment for this compilation unit. The header comment
25  * appears before the first declaration in a compilation unit.
26  * The syntax for a comment corresponds to Comments (JLS2 3.7), <b>including</b>
27  * comment delimiters.
28  *
29  * @return the header comment for this compilation unit, or <code>null</code> if
30  *   no header comment is present
31  */
32 public String getHeader();
33 /**
34  * The <code>IDOMCompilationNode</code> refinement of this <code>IDOMNode</code>
35  * method returns the name of this compilation unit.
36  *
37  * <p>The name of a compilation unit is the name of the first top-level public type
38  * defined in the compilation unit, suffixed with ".java". For example, if the first
39  * top-level public type defined in this compilation unit has the name "Hanoi",
40  * then name of this compilation unit is "Hanoi.java".</p>
41  *
42  * <p>In the absence of a public top-level type, the name of the first top-level
43  * type is used. In the absence of any type, the name of the compilation unit
44  * is <code>null</code>.</p>
45  *
46  * @return the name of this compilation unit, or <code>null</code> if none
47  */
48 public String getName();
49 /**
50  * Sets the header comment for this compilation unit. The header comment
51  * appears before the first declaration in a compilation unit.
52  * The syntax for a comment corresponds to Comments (JLS2 3.7), <b>including</b>
53  * comment delimiters.
54  *
55  * @param comment the header comment for this compilation unit, or <code>null</code> if
56  *   indicating no header comment
57  */
58 public void setHeader(String comment);
59 /**
60  * The <code>IDOMCompilationNode</code> refinement of this <code>IDOMNode</code>
61  * method has no effect (the name is computed from the types declared within it).
62  */
63 public void setName(String name);
64 }