Java.ArrayInitializerOrRvalue
, Java.ElementValue
, Java.Locatable
public static final class Java.NewArray extends Java.Rvalue
Modifier and Type | Field | Description |
---|---|---|
Java.Rvalue[] |
dimExprs |
The sizes of the first dimensions to instantiate.
|
int |
dims |
The count of additional dimensions that the array should have.
|
Java.Type |
type |
NOWHERE
Constructor | Description |
---|---|
NewArray(Location location,
Java.Type type,
Java.Rvalue[] dimExprs,
int dims) |
Create a new array with dimension dimExprs.length + dims
|
Modifier and Type | Method | Description |
---|---|---|
void |
accept(Visitor.AtomVisitor visitor) |
|
void |
accept(Visitor.ElementValueVisitor visitor) |
Invokes the '
visit...() ' method of Visitor.ElementValueVisitor for the concrete Java.ElementValue type. |
void |
accept(Visitor.RvalueVisitor visitor) |
|
String |
toString() |
toLvalue, toLvalueOrCompileException, toRvalueOrCompileException, toType, toTypeOrCompileException
getLocation, throwCompileException
getLocation, throwCompileException
getEnclosingBlockStatement, setEnclosingBlockStatement, toRvalue
public final Java.Type type
public final Java.Rvalue[] dimExprs
public final int dims
public NewArray(Location location, Java.Type type, Java.Rvalue[] dimExprs, int dims)
e.g. byte[12][][] is created with
new NewArray( null, Java.BasicType(NULL, Java.BasicType.BYTE), new Rvalue[] { new Java.Literal(null, Integer.valueOf(12) }, 2 )
location
- the location of this elementtype
- the base type of the arraydimExprs
- sizes for dimensions being allocated with specific sizesdims
- the number of dimensions that are not yet allocatedpublic void accept(Visitor.AtomVisitor visitor)
Java.Atom
public void accept(Visitor.RvalueVisitor visitor)
Java.Rvalue
accept
in class Java.Rvalue
public void accept(Visitor.ElementValueVisitor visitor)
Java.ElementValue
visit...()
' method of Visitor.ElementValueVisitor
for the concrete Java.ElementValue
type.Copyright © 2001–2019. All rights reserved.