<s> package org . eclipse . jdt . core . dom ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . List ; import java . util . Map ; public class Assignment extends Expression { public static class Operator { private String op ; private Operator ( String op ) { this . op = op ; } public String toString ( ) { return this . op ; } public static final Operator ASSIGN = new Operator ( "=" ) ; public static final Operator PLUS_ASSIGN = new Operator ( "+=" ) ; public static final Operator MINUS_ASSIGN = new Operator ( "-=" ) ; public static final Operator TIMES_ASSIGN = new Operator ( "*=" ) ; public static final Operator DIVIDE_ASSIGN = new Operator ( "/=" ) ; public static final Operator BIT_AND_ASSIGN = new Operator ( "&=" ) ; public static final Operator BIT_OR_ASSIGN = new Operator ( "|=" ) ; public static final Operator BIT_XOR_ASSIGN = new Operator ( "^=" ) ; public static final Operator REMAINDER_ASSIGN = new Operator ( "%=" ) ; public static final Operator LEFT_SHIFT_ASSIGN = new Operator ( "<<=" ) ; public static final Operator RIGHT_SHIFT_SIGNED_ASSIGN = new Operator ( ">>=" ) ; public static final Operator RIGHT_SHIFT_UNSIGNED_ASSIGN = new Operator ( ">>>=" ) ; public static Operator toOperator ( String token ) { return ( Operator ) CODES . get ( token ) ; } private static final Map CODES ; static { CODES = new HashMap ( 20 ) ; Operator [ ] ops = { ASSIGN , PLUS_ASSIGN , MINUS_ASSIGN , TIMES_ASSIGN , DIVIDE_ASSIGN , BIT_AND_ASSIGN , BIT_OR_ASSIGN , BIT_XOR_ASSIGN , REMAINDER_ASSIGN , LEFT_SHIFT_ASSIGN , RIGHT_SHIFT_SIGNED_ASSIGN , RIGHT_SHIFT_UNSIGNED_ASSIGN } ; for ( int i = 0 ; i < ops . length ; i ++ ) { CODES . put ( ops [ i ] . toString ( ) , ops [ i ] ) ; } } } public static final ChildPropertyDescriptor LEFT_HAND_SIDE_PROPERTY = new ChildPropertyDescriptor ( Assignment . class , "leftHandSide" , Expression . class , MANDATORY , CYCLE_RISK ) ; public static final SimplePropertyDescriptor OPERATOR_PROPERTY = new SimplePropertyDescriptor ( Assignment . class , "operator" , Assignment . Operator . class , MANDATORY ) ; public static final ChildPropertyDescriptor RIGHT_HAND_SIDE_PROPERTY = new ChildPropertyDescriptor ( Assignment . class , "" , Expression . class , MANDATORY , CYCLE_RISK ) ; private static final List PROPERTY_DESCRIPTORS ; static { List properyList = new ArrayList ( 4 ) ; createPropertyList ( Assignment . class , properyList ) ; addProperty ( LEFT_HAND_SIDE_PROPERTY , properyList ) ; addProperty ( OPERATOR_PROPERTY , properyList ) ; addProperty ( RIGHT_HAND_SIDE_PROPERTY , properyList ) ; PROPERTY_DESCRIPTORS = reapPropertyList ( properyList ) ; } public static List propertyDescriptors ( int apiLevel ) { return PROPERTY_DESCRIPTORS ; } private Assignment . Operator assignmentOperator = Assignment . Operator . ASSIGN ; private Expression leftHandSide = null ; private Expression rightHandSide = null ; Assignment ( AST ast ) { super ( ast ) ; } final List internalStructuralPropertiesForType ( int apiLevel ) { return propertyDescriptors ( apiLevel ) ; } final Object internalGetSetObjectProperty ( SimplePropertyDescriptor property , boolean get , Object value ) { if ( property == OPERATOR_PROPERTY ) { if ( get ) { return getOperator ( ) ; } else { setOperator ( ( Operator ) value ) ; return null ; } } return super . internalGetSetObjectProperty ( property , get , value ) ; } final ASTNode internalGetSetChildProperty ( ChildPropertyDescriptor property , boolean get , ASTNode child ) { if ( property == LEFT_HAND_SIDE_PROPERTY ) { if ( get ) { return getLeftHandSide ( ) ; } else { setLeftHandSide ( ( Expression ) child ) ; return null ; } } if ( property == RIGHT_HAND_SIDE_PROPERTY ) { if ( get ) { return getRightHandSide ( ) ; } else { setRightHandSide ( ( Expression ) child ) ; return null ; } } return super . internalGetSetChildProperty ( property , get , child ) ; } final int getNodeType0 ( ) { return ASSIGNMENT ; } ASTNode clone0 ( AST target ) { Assignment result = new Assignment ( target ) ; result . setSourceRange ( getStartPosition ( ) , getLength ( ) ) ; result . setOperator ( getOperator ( ) ) ; result . setLeftHandSide ( ( Expression ) getLeftHandSide ( ) . clone ( target ) ) ; result . setRightHandSide ( ( Expression ) getRightHandSide ( ) . 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 , getLeftHandSide ( ) ) ; acceptChild ( visitor , getRightHandSide ( ) ) ; } visitor . endVisit ( this ) ; } public Assignment . Operator getOperator ( ) { return this . assignmentOperator ; } public void setOperator ( Assignment . Operator assignmentOperator ) { if ( assignmentOperator == null ) { throw new IllegalArgumentException ( ) ; } preValueChange ( OPERATOR_PROPERTY ) ; this . assignmentOperator = assignmentOperator ; postValueChange ( OPERATOR_PROPERTY ) ; } public Expression getLeftHandSide ( ) { if ( this . leftHandSide == null ) { synchronized ( this ) { if ( this . leftHandSide == null ) { preLazyInit ( ) ; this . leftHandSide = new SimpleName ( this . ast ) ; postLazyInit ( this . leftHandSide , LEFT_HAND_SIDE_PROPERTY ) ; } } } return this . leftHandSide ; } public void setLeftHandSide ( Expression expression ) { if ( expression == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . leftHandSide ; preReplaceChild ( oldChild , expression , LEFT_HAND_SIDE_PROPERTY ) ; this . leftHandSide = expression ; postReplaceChild ( oldChild , expression , LEFT_HAND_SIDE_PROPERTY ) ; } public Expression getRightHandSide ( ) { if ( this . rightHandSide == null ) { synchronized ( this ) { if ( this . rightHandSide == null ) { preLazyInit ( ) ; this . rightHandSide = new SimpleName ( this . ast ) ; postLazyInit ( this . rightHandSide , RIGHT_HAND_SIDE_PROPERTY ) ; } } } return this . rightHandSide ; } public void setRightHandSide ( Expression expression ) { if ( expression == null ) { throw new IllegalArgumentException ( ) ; } ASTNode oldChild = this . rightHandSide ; preReplaceChild ( oldChild , expression , RIGHT_HAND_SIDE_PROPERTY ) ; this . rightHandSide = expression ; postReplaceChild ( oldChild , expression , RIGHT_HAND_SIDE_PROPERTY ) ; } int memSize ( ) { return BASE_NODE_SIZE + 3 * 4 ; } int treeSize ( ) { return memSize ( ) + ( this . leftHandSide == null ? 0 : getLeftHandSide ( ) . treeSize ( ) ) + ( this . rightHandSide == null ? 0 : getRightHandSide ( ) . treeSize ( ) ) ; } } </s>