diff options
Diffstat (limited to 'plugins/org.eclipse.jem/javainst/org/eclipse/jem/internal/instantiation/impl/PTArrayCreationImpl.java')
-rw-r--r-- | plugins/org.eclipse.jem/javainst/org/eclipse/jem/internal/instantiation/impl/PTArrayCreationImpl.java | 299 |
1 files changed, 0 insertions, 299 deletions
diff --git a/plugins/org.eclipse.jem/javainst/org/eclipse/jem/internal/instantiation/impl/PTArrayCreationImpl.java b/plugins/org.eclipse.jem/javainst/org/eclipse/jem/internal/instantiation/impl/PTArrayCreationImpl.java deleted file mode 100644 index 1ba8b3cdb..000000000 --- a/plugins/org.eclipse.jem/javainst/org/eclipse/jem/internal/instantiation/impl/PTArrayCreationImpl.java +++ /dev/null @@ -1,299 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.jem.internal.instantiation.impl; -/* - - - */ -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.eclipse.jem.internal.instantiation.*; -import org.eclipse.jem.internal.instantiation.PTArrayCreation; -import org.eclipse.jem.internal.instantiation.PTArrayInitializer; -import org.eclipse.jem.internal.instantiation.PTExpression; -import org.eclipse.jem.internal.instantiation.InstantiationPackage; - -/** - * <!-- begin-user-doc --> - * An implementation of the model object '<em><b>Array Creation</b></em>'. - * <!-- end-user-doc --> - * <p> - * The following features are implemented: - * <ul> - * <li>{@link org.eclipse.jem.internal.instantiation.impl.PTArrayCreationImpl#getType <em>Type</em>}</li> - * <li>{@link org.eclipse.jem.internal.instantiation.impl.PTArrayCreationImpl#getDimensions <em>Dimensions</em>}</li> - * <li>{@link org.eclipse.jem.internal.instantiation.impl.PTArrayCreationImpl#getInitializer <em>Initializer</em>}</li> - * </ul> - * </p> - * - * @generated - */ -public class PTArrayCreationImpl extends PTExpressionImpl implements PTArrayCreation { - /** - * The default value of the '{@link #getType() <em>Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getType() - * @generated - * @ordered - */ - protected static final String TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getType() <em>Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getType() - * @generated - * @ordered - */ - protected String type = TYPE_EDEFAULT; - - /** - * The cached value of the '{@link #getDimensions() <em>Dimensions</em>}' containment reference list. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getDimensions() - * @generated - * @ordered - */ - protected EList dimensions = null; - - /** - * The cached value of the '{@link #getInitializer() <em>Initializer</em>}' containment reference. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getInitializer() - * @generated - * @ordered - */ - protected PTArrayInitializer initializer = null; - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected PTArrayCreationImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - protected EClass eStaticClass() { - return InstantiationPackage.eINSTANCE.getPTArrayCreation(); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public String getType() { - return type; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setType(String newType) { - String oldType = type; - type = newType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, InstantiationPackage.PT_ARRAY_CREATION__TYPE, oldType, type)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public EList getDimensions() { - if (dimensions == null) { - dimensions = new EObjectContainmentEList(PTExpression.class, this, InstantiationPackage.PT_ARRAY_CREATION__DIMENSIONS); - } - return dimensions; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public PTArrayInitializer getInitializer() { - return initializer; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain basicSetInitializer(PTArrayInitializer newInitializer, NotificationChain msgs) { - PTArrayInitializer oldInitializer = initializer; - initializer = newInitializer; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, InstantiationPackage.PT_ARRAY_CREATION__INITIALIZER, oldInitializer, newInitializer); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void setInitializer(PTArrayInitializer newInitializer) { - if (newInitializer != initializer) { - NotificationChain msgs = null; - if (initializer != null) - msgs = ((InternalEObject)initializer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - InstantiationPackage.PT_ARRAY_CREATION__INITIALIZER, null, msgs); - if (newInitializer != null) - msgs = ((InternalEObject)newInitializer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - InstantiationPackage.PT_ARRAY_CREATION__INITIALIZER, null, msgs); - msgs = basicSetInitializer(newInitializer, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, InstantiationPackage.PT_ARRAY_CREATION__INITIALIZER, newInitializer, newInitializer)); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { - if (featureID >= 0) { - switch (eDerivedStructuralFeatureID(featureID, baseClass)) { - case InstantiationPackage.PT_ARRAY_CREATION__DIMENSIONS: - return ((InternalEList)getDimensions()).basicRemove(otherEnd, msgs); - case InstantiationPackage.PT_ARRAY_CREATION__INITIALIZER: - return basicSetInitializer(null, msgs); - default: - return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); - } - } - return eBasicSetContainer(null, featureID, msgs); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public Object eGet(EStructuralFeature eFeature, boolean resolve) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case InstantiationPackage.PT_ARRAY_CREATION__TYPE: - return getType(); - case InstantiationPackage.PT_ARRAY_CREATION__DIMENSIONS: - return getDimensions(); - case InstantiationPackage.PT_ARRAY_CREATION__INITIALIZER: - return getInitializer(); - } - return eDynamicGet(eFeature, resolve); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eSet(EStructuralFeature eFeature, Object newValue) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case InstantiationPackage.PT_ARRAY_CREATION__TYPE: - setType((String)newValue); - return; - case InstantiationPackage.PT_ARRAY_CREATION__DIMENSIONS: - getDimensions().clear(); - getDimensions().addAll((Collection)newValue); - return; - case InstantiationPackage.PT_ARRAY_CREATION__INITIALIZER: - setInitializer((PTArrayInitializer)newValue); - return; - } - eDynamicSet(eFeature, newValue); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public void eUnset(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case InstantiationPackage.PT_ARRAY_CREATION__TYPE: - setType(TYPE_EDEFAULT); - return; - case InstantiationPackage.PT_ARRAY_CREATION__DIMENSIONS: - getDimensions().clear(); - return; - case InstantiationPackage.PT_ARRAY_CREATION__INITIALIZER: - setInitializer((PTArrayInitializer)null); - return; - } - eDynamicUnset(eFeature); - } - - /** - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - */ - public boolean eIsSet(EStructuralFeature eFeature) { - switch (eDerivedStructuralFeatureID(eFeature)) { - case InstantiationPackage.PT_ARRAY_CREATION__TYPE: - return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); - case InstantiationPackage.PT_ARRAY_CREATION__DIMENSIONS: - return dimensions != null && !dimensions.isEmpty(); - case InstantiationPackage.PT_ARRAY_CREATION__INITIALIZER: - return initializer != null; - } - return eDynamicIsSet(eFeature); - } - - public String toString() { - return super.toString(); // Really want toString to be final at PTExpression, but EMF doesn't allow it. - } - - /* - * (non-Javadoc) - * @see org.eclipse.jem.internal.instantiation.impl.ExpressionImpl#accept0(org.eclipse.jem.internal.instantiation.ParseVisitor) - */ - protected void accept0(ParseVisitor visitor) { - boolean visitChildren = visitor.visit(this); - if (visitChildren) { - // visit children in normal left to right reading order - acceptChildren(visitor, dimensions); - acceptChild(visitor, getInitializer()); - } - visitor.endVisit(this); - } -} //ArrayCreationImpl |