org.codehaus.groovy.ast.expr
Class ArrayExpression
java.lang.Object
org.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.expr.Expression
org.codehaus.groovy.ast.expr.ArrayExpression
- public class ArrayExpression
- extends Expression
Represents an array object construction either using a fixed size
or an initializer expression
- Version:
- $Revision: 1.10 $
- Author:
- James Strachan
Constructor Summary |
ArrayExpression(java.lang.String type,
Expression sizeExpression)
Creates an empty array of a certain size |
ArrayExpression(java.lang.String type,
java.util.List expressions)
Creates an array using an initializer expression |
Methods inherited from class org.codehaus.groovy.ast.expr.Expression |
getFailure, getType, getTypeClass, isResolveFailed, isTypeResolved, resolve, setFailure, setResolveFailed, setType, setTypeClass, setTypeResolved, shouldContinue, transformExpressions |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
expressions
private java.util.List expressions
sizeExpression
private Expression sizeExpression
elementType
private java.lang.String elementType
ArrayExpression
public ArrayExpression(java.lang.String type,
java.util.List expressions)
- Creates an array using an initializer expression
ArrayExpression
public ArrayExpression(java.lang.String type,
Expression sizeExpression)
- Creates an empty array of a certain size
setSuperType
private void setSuperType(java.lang.String type)
addExpression
public void addExpression(Expression expression)
getExpressions
public java.util.List getExpressions()
visit
public void visit(GroovyCodeVisitor visitor)
- Overrides:
visit
in class ASTNode
isDynamic
public boolean isDynamic()
- Description copied from class:
Expression
- true if the datatype can be changed, false otherwise.
- Overrides:
isDynamic
in class Expression
- Returns:
transformExpression
public Expression transformExpression(ExpressionTransformer transformer)
- Description copied from class:
Expression
- Return a copy of the expression calling the transformer on any nested expressions
- Specified by:
transformExpression
in class Expression
- Parameters:
transformer
-
- Returns:
getExpression
public Expression getExpression(int i)
getElementType
public java.lang.String getElementType()
getText
public java.lang.String getText()
- Overrides:
getText
in class ASTNode
getSizeExpression
public Expression getSizeExpression()
toString
public java.lang.String toString()
resolveType
protected void resolveType(AsmClassGenerator resolver)
- Specified by:
resolveType
in class Expression
Copyright © 2003-2005 The Codehaus. All Rights Reserved.