com.go.tea.parsetree
Class NewArrayExpression

java.lang.Object
  |
  +--com.go.tea.parsetree.Node
        |
        +--com.go.tea.parsetree.Expression
              |
              +--com.go.tea.parsetree.NewArrayExpression
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class NewArrayExpression
extends Expression

An expression that evaluates to a new array or Map of values.

Version:
21 , 9/07/00
Author:
Brian S O'Neill
See Also:
Serialized Form

Inner classes inherited from class com.go.tea.parsetree.Expression
Expression.Conversion
 
Constructor Summary
NewArrayExpression(SourceInfo info, ExpressionList list, boolean associative)
           
 
Method Summary
 java.lang.Object accept(NodeVisitor visitor)
          Every subclass of Node must override this method with the following: return visitor.visit(this).
 java.lang.Object clone()
          Returns a clone of this Node and all its children.
 void convertTo(Type toType, boolean preferCast)
          Applies a type conversion to this expression which is chained to all previous conversions.
 ExpressionList getExpressionList()
           
 boolean isAllConstant()
           
 boolean isAssociative()
           
 boolean isExceptionPossible()
          Returns true if an exception can be thrown while executing this Expression.
 void setExpressionList(ExpressionList list)
           
 void setType(Type type)
          Sets the type of this expression, clearing the conversion chain.
 
Methods inherited from class com.go.tea.parsetree.Expression
convertTo, getConversionChain, getInitialType, getType, getValue, isValueKnown, setInitialType
 
Methods inherited from class com.go.tea.parsetree.Node
getSourceInfo, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NewArrayExpression

public NewArrayExpression(SourceInfo info,
                          ExpressionList list,
                          boolean associative)
Method Detail

clone

public java.lang.Object clone()
Description copied from class: Node
Returns a clone of this Node and all its children. Immutable child objects are not necessarily cloned
Overrides:
clone in class Expression

isExceptionPossible

public boolean isExceptionPossible()
Description copied from class: Expression
Returns true if an exception can be thrown while executing this Expression. By default, returns true only if a type conversion could cause an exception.
Overrides:
isExceptionPossible in class Expression

accept

public java.lang.Object accept(NodeVisitor visitor)
Description copied from class: Node
Every subclass of Node must override this method with the following: return visitor.visit(this).
Overrides:
accept in class Expression
Following copied from class: com.go.tea.parsetree.Node
Parameters:
visitor - A visitor of this Node
Returns:
Node The Node returned by the visitor
See Also:
NodeVisitor

convertTo

public void convertTo(Type toType,
                      boolean preferCast)
Description copied from class: Expression
Applies a type conversion to this expression which is chained to all previous conversions.
Overrides:
convertTo in class Expression
Following copied from class: com.go.tea.parsetree.Expression
Parameters:
toType - the type to convert to.
preferCast - a hint that the conversion should be performed by a type cast operation, by default is true.
Throws:
java.lang.IllegalArgumentException - when the conversion is illegal.

setType

public void setType(Type type)
Description copied from class: Expression
Sets the type of this expression, clearing the conversion chain.
Overrides:
setType in class Expression

getExpressionList

public ExpressionList getExpressionList()

isAssociative

public boolean isAssociative()

setExpressionList

public void setExpressionList(ExpressionList list)

isAllConstant

public boolean isAllConstant()
Returns:
true if this array is composed entirely of constants.