KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > ast > New


1 package polyglot.ast;
2
3 import polyglot.types.ConstructorInstance;
4 import polyglot.types.ParsedClassType;
5 import java.util.List JavaDoc;
6
7 /**
8  * A <code>New</code> is an immutable representation of the use of the
9  * <code>new</code> operator to create a new instance of a class. In
10  * addition to the type of the class being created, a <code>New</code> has a
11  * list of arguments to be passed to the constructor of the object and an
12  * optional <code>ClassBody</code> used to support anonymous classes.
13  */

14 public interface New extends Expr, ProcedureCall
15 {
16     /** The type object for anonymous classes, or null. */
17     ParsedClassType anonType();
18
19     /** Set the type object for anonymous classes. */
20     New anonType(ParsedClassType anonType);
21
22     /** The constructor invoked by this expression. */
23     ConstructorInstance constructorInstance();
24
25     /** Set the constructor invoked by this expression. */
26     New constructorInstance(ConstructorInstance ci);
27
28     /**
29      * The qualifier expression for the type, or null. If non-null, this
30      * expression creates an inner class of the static type of the qualifier.
31      */

32     Expr qualifier();
33
34     /** Set the qualifier expression for the type. */
35     New qualifier(Expr qualifier);
36
37     /** The type we are creating, possibly qualified by qualifier. */
38     TypeNode objectType();
39
40     /** Set the type we are creating. */
41     New objectType(TypeNode t);
42
43     /** Actual arguments to pass to the constructor.
44      * @return A list of {@link polyglot.ast.Expr Expr}.
45      */

46     List JavaDoc arguments();
47
48     /** Set the actual arguments to pass to the constructor.
49      * @param arguments A list of {@link polyglot.ast.Expr Expr}.
50      */

51     ProcedureCall arguments(List JavaDoc arguments);
52
53     /** The class body for anonymous classes, or null. */
54     ClassBody body();
55
56     /** Set the class body for anonymous classes. */
57     New body(ClassBody b);
58 }
59
Popular Tags