<s> package org . eclipse . jdt . core . dom ; import java . util . ArrayList ; import java . util . List ; public class ArrayAccess extends Expression { public static final ChildPropertyDescriptor ARRAY_PROPERTY = new ChildPropertyDescriptor ( ArrayAccess . class , "array" , Expression . class , MANDATORY , CYCLE_RISK ) ; public static final ChildPropertyDescriptor INDEX_PROPERTY = new ChildPropertyDescriptor ( ArrayAccess . class , "index" , Expression . class , MANDATORY , CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; static { List properyList = new ArrayList ( 3 ) ; createPropertyList ( ArrayAccess . class , properyList ) ; addProperty ( ARRAY_PROPERTY , properyList ) ; addProperty ( INDEX_PROPERTY , properyList ) ; PROPERTY_DESCRIPTORS = reapPropertyList ( properyList ) ; } public static List propertyDescriptors ( int apiLevel ) { return PROPERTY_DESCRIPTORS ; } private Expression arrayExpression = null ; private Expression indexExpression = null ; ArrayAccess ( AST ast ) { super ( ast ) ; } final List internalStructuralPropertiesForType ( int apiLevel ) { return propertyDescriptors ( apiLevel ) ; } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { if ( property == ARRAY_PROPERTY ) { if ( get ) { return getArray ( ) ; } else { setArray ( ( Expression ) child ) ; return null ; } } if ( property == INDEX_PROPERTY ) { if ( get ) { return getIndex ( ) ; } else { setIndex ( ( Expression ) child ) ; return null ; } } return super . internalGetSetChildProperty ( property , get , child ) ; } final int getNodeType0 ( ) { return ARRAY_ACCESS ; } ASTNode clone0 ( AST target ) { ArrayAccess result = new ArrayAccess ( target ) ; result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ; result . setArray ( ( Expression ) getArray ( ) . clone ( target ) ) ; result . setIndex ( ( Expression ) getIndex ( ) . clone ( target ) ) ; return result ; } final boolean subtreeMatch0 ( ASTMatcher matcher , Object other ) { return matcher . match ( this , other ) ; } void accept0 ( ASTVisitor visitor ) { boolean visitChildren = visitor . visit ( this ) ; if ( visitChildren ) { acceptChild ( visitor , getArray ( ) ) ; acceptChild ( visitor , getIndex ( ) ) ; } visitor . endVisit ( this ) ; } public Expression getArray ( ) { if ( this . arrayExpression == null ) { synchronized ( this ) { if ( this . arrayExpression == null ) { preLazyInit ( ) ; this . arrayExpression = new SimpleName ( this . ast ) ; postLazyInit ( this . arrayExpression , ARRAY_PROPERTY ) ; } } } return this . arrayExpression ; } public void setArray ( Expression expression ) { if ( expression == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . arrayExpression ; preReplaceChild ( oldChild , expression , ARRAY_PROPERTY ) ; this . arrayExpression = expression ; postReplaceChild ( oldChild , expression , ARRAY_PROPERTY ) ; } public Expression getIndex ( ) { if ( this . indexExpression == null ) { synchronized ( this ) { if ( this . indexExpression == null ) { preLazyInit ( ) ; this . indexExpression = new SimpleName ( this . ast ) ; postLazyInit ( this . indexExpression , INDEX_PROPERTY ) ; } } } return this . indexExpression ; } public void setIndex ( Expression expression ) { if ( expression == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . indexExpression ; preReplaceChild ( oldChild , expression , INDEX_PROPERTY ) ; this . indexExpression = expression ; postReplaceChild ( oldChild , expression , INDEX_PROPERTY ) ; } int memSize ( ) { return BASE_NODE_SIZE + 2 * 4 ; } int treeSize ( ) { return memSize ( ) + ( this . arrayExpression == null ? 0 : getArray ( ) . treeSize ( ) ) + ( this . indexExpression == null ? 0 : getIndex ( ) . treeSize ( ) ) ; } } </s>