KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > ast > Import


1 package polyglot.ast;
2
3 import polyglot.util.Enum;
4
5 /**
6  * An <code>Import</code> is an immutable representation of a Java
7  * <code>import</code> statement. It consists of the string representing the
8  * item being imported and the kind which is either indicating that a class
9  * is being imported, or that an entire package is being imported.
10  */

11 public interface Import extends Node
12 {
13     /** Import kinds: class (e.g., import java.util.Set) or package (e.g.,
14      * import java.util.*).
15      *
16      * PACKAGE is a bit of a misnomer, since we can import p.C.*, where p.C
17      * is a class. This puts the nested classes of p.C in scope.
18      */

19     public static class Kind extends Enum JavaDoc {
20         public Kind(String JavaDoc name) { super(name); }
21     }
22
23     public static final Kind CLASS = new Kind("class");
24     public static final Kind PACKAGE = new Kind("package");
25
26     /** Get the name of the class or package to import. */
27     String JavaDoc name();
28     /** Set the name of the class or package to import. */
29     Import name(String JavaDoc name);
30
31     /** Get the kind of import. */
32     Kind kind();
33     /** Set the kind of import. */
34     Import kind(Kind kind);
35 }
36
Popular Tags