public interface NodeWithVariables<N extends Node>
Modifier and Type | Method and Description |
---|---|
default Type |
getCommonType()
Returns the type that is shared between all variables.
|
default Type |
getElementType()
Returns the element type.
|
default VariableDeclarator |
getVariable(int i) |
NodeList<VariableDeclarator> |
getVariables() |
N |
setVariables(NodeList<VariableDeclarator> variables) |
NodeList<VariableDeclarator> getVariables()
N setVariables(NodeList<VariableDeclarator> variables)
default VariableDeclarator getVariable(int i)
default Type getCommonType()
int a;
this is int.
int a,b,c,d;
this is also int.
int a,b[],c;
this is an assertion error since b is an int[], not an int.
int a,b;
, then doing setType(String) on b, this is an assertion error. It is also a situation that you don't really want.default Type getElementType()
int a;
this is int.
int a,b,c,d;
this is also int.
int a,b[],c;
this is also int. Note: no mention of b being an array.
int a,b;
, then doing setType(String) on b, this is an assertion error. It is also a situation that you don't really want.Copyright © 2007–2016. All rights reserved.