polyglot.ast
Interface New

All Superinterfaces:
java.lang.Cloneable, Copy, Expr, JL, Node, NodeOps, Prefix, ProcedureCall, Receiver, Term, Typed
All Known Implementing Classes:
New_c

public interface New
extends Expr, ProcedureCall

A New is an immutable representation of the use of the new operator to create a new instance of a class. In addition to the type of the class being created, a New has a list of arguments to be passed to the constructor of the object and an optional ClassBody used to support anonymous classes.


Method Summary
 ParsedClassType anonType()
          The type object for anonymous classes, or null.
 New anonType(ParsedClassType anonType)
          Set the type object for anonymous classes.
 java.util.List arguments()
          Actual arguments to pass to the constructor.
 ProcedureCall arguments(java.util.List arguments)
          Set the actual arguments to pass to the constructor.
 ClassBody body()
          The class body for anonymous classes, or null.
 New body(ClassBody b)
          Set the class body for anonymous classes.
 ConstructorInstance constructorInstance()
          The constructor invoked by this expression.
 New constructorInstance(ConstructorInstance ci)
          Set the constructor invoked by this expression.
 TypeNode objectType()
          The type we are creating, possibly qualified by qualifier.
 New objectType(TypeNode t)
          Set the type we are creating.
 Expr qualifier()
          The qualifier expression for the type, or null.
 New qualifier(Expr qualifier)
          Set the qualifier expression for the type.
 
Methods inherited from interface polyglot.ast.Expr
constantValue, isConstant, precedence, printSubExpr, printSubExpr, type
 
Methods inherited from interface polyglot.ast.Node
childExpectedType, del, del, dump, ext, ext, ext, ext, position, position, visit, visitChild, visitEdge, visitList
 
Methods inherited from interface polyglot.ast.JL
init, node
 
Methods inherited from interface polyglot.ast.NodeOps
addDecls, addMembers, addMembersEnter, buildTypes, buildTypesEnter, disambiguate, disambiguateEnter, enterScope, enterScope, exceptionCheck, exceptionCheckEnter, prettyPrint, throwTypes, translate, typeCheck, typeCheckEnter, visitChildren
 
Methods inherited from interface polyglot.util.Copy
copy
 
Methods inherited from interface polyglot.ast.Typed
type
 
Methods inherited from interface polyglot.ast.Term
acceptCFG, entry, exceptions, exceptions, reachable, reachable
 
Methods inherited from interface polyglot.ast.ProcedureCall
procedureInstance
 

Method Detail

anonType

public ParsedClassType anonType()
The type object for anonymous classes, or null.


anonType

public New anonType(ParsedClassType anonType)
Set the type object for anonymous classes.


constructorInstance

public ConstructorInstance constructorInstance()
The constructor invoked by this expression.


constructorInstance

public New constructorInstance(ConstructorInstance ci)
Set the constructor invoked by this expression.


qualifier

public Expr qualifier()
The qualifier expression for the type, or null. If non-null, this expression creates an inner class of the static type of the qualifier.


qualifier

public New qualifier(Expr qualifier)
Set the qualifier expression for the type.


objectType

public TypeNode objectType()
The type we are creating, possibly qualified by qualifier.


objectType

public New objectType(TypeNode t)
Set the type we are creating.


arguments

public java.util.List arguments()
Actual arguments to pass to the constructor.

Specified by:
arguments in interface ProcedureCall
Returns:
A list of Expr.

arguments

public ProcedureCall arguments(java.util.List arguments)
Set the actual arguments to pass to the constructor.

Specified by:
arguments in interface ProcedureCall
Parameters:
arguments - A list of Expr.

body

public ClassBody body()
The class body for anonymous classes, or null.


body

public New body(ClassBody b)
Set the class body for anonymous classes.