blob: c523a03fc2a6a7ff65a2f1df39096245d0887053 [file] [log] [blame]
/*
* Copyright (c) 2005, 2006 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 - initial API and implementation
*
* $Id: InstanceSpecificationImpl.java,v 1.19 2006/12/14 15:49:30 khussey Exp $
*/
package org.eclipse.uml2.uml.internal.impl;
import java.util.Collection;
import java.util.Map;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.DiagnosticChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.EObjectResolvingEList;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.uml2.common.util.CacheAdapter;
import org.eclipse.uml2.common.util.DerivedUnionEObjectEList;
import org.eclipse.uml2.uml.Classifier;
import org.eclipse.uml2.uml.Comment;
import org.eclipse.uml2.uml.Dependency;
import org.eclipse.uml2.uml.DeployedArtifact;
import org.eclipse.uml2.uml.Deployment;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.InstanceSpecification;
import org.eclipse.uml2.uml.PackageableElement;
import org.eclipse.uml2.uml.ParameterableElement;
import org.eclipse.uml2.uml.Slot;
import org.eclipse.uml2.uml.StringExpression;
import org.eclipse.uml2.uml.TemplateParameter;
import org.eclipse.uml2.uml.Type;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.ValueSpecification;
import org.eclipse.uml2.uml.VisibilityKind;
import org.eclipse.uml2.uml.internal.operations.InstanceSpecificationOperations;
import org.eclipse.uml2.uml.internal.operations.ParameterableElementOperations;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Instance Specification</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.uml2.uml.internal.impl.InstanceSpecificationImpl#getOwner <em>Owner</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.InstanceSpecificationImpl#getTemplateParameter <em>Template Parameter</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.InstanceSpecificationImpl#getOwningTemplateParameter <em>Owning Template Parameter</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.InstanceSpecificationImpl#getVisibility <em>Visibility</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.InstanceSpecificationImpl#getOwnedElements <em>Owned Element</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.InstanceSpecificationImpl#getClassifiers <em>Classifier</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.InstanceSpecificationImpl#getSlots <em>Slot</em>}</li>
* <li>{@link org.eclipse.uml2.uml.internal.impl.InstanceSpecificationImpl#getSpecification <em>Specification</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class InstanceSpecificationImpl
extends DeploymentTargetImpl
implements InstanceSpecification {
/**
* The cached value of the '{@link #getTemplateParameter() <em>Template Parameter</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTemplateParameter()
* @generated
* @ordered
*/
protected TemplateParameter templateParameter = null;
/**
* The cached value of the '{@link #getClassifiers() <em>Classifier</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getClassifiers()
* @generated
* @ordered
*/
protected EList<Classifier> classifiers = null;
/**
* The cached value of the '{@link #getSlots() <em>Slot</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSlots()
* @generated
* @ordered
*/
protected EList<Slot> slots = null;
/**
* The cached value of the '{@link #getSpecification() <em>Specification</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSpecification()
* @generated
* @ordered
*/
protected ValueSpecification specification = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected InstanceSpecificationImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return UMLPackage.Literals.INSTANCE_SPECIFICATION;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Element getOwner() {
Element owner = basicGetOwner();
return owner != null && owner.eIsProxy()
? (Element) eResolveProxy((InternalEObject) owner)
: owner;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateParameter getTemplateParameter() {
if (templateParameter != null && templateParameter.eIsProxy()) {
InternalEObject oldTemplateParameter = (InternalEObject) templateParameter;
templateParameter = (TemplateParameter) eResolveProxy(oldTemplateParameter);
if (templateParameter != oldTemplateParameter) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER,
oldTemplateParameter, templateParameter));
}
}
return templateParameter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateParameter basicGetTemplateParameter() {
return templateParameter;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetTemplateParameter(
TemplateParameter newTemplateParameter, NotificationChain msgs) {
TemplateParameter oldTemplateParameter = templateParameter;
templateParameter = newTemplateParameter;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this,
Notification.SET,
UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER,
oldTemplateParameter, newTemplateParameter);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
Resource.Internal eInternalResource = eInternalResource();
if (eInternalResource == null || !eInternalResource.isLoading()) {
TemplateParameter owningTemplateParameter = basicGetOwningTemplateParameter();
if (owningTemplateParameter != null
&& owningTemplateParameter != newTemplateParameter) {
setOwningTemplateParameter(null);
}
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTemplateParameter(TemplateParameter newTemplateParameter) {
if (newTemplateParameter != templateParameter) {
NotificationChain msgs = null;
if (templateParameter != null)
msgs = ((InternalEObject) templateParameter).eInverseRemove(
this, UMLPackage.TEMPLATE_PARAMETER__PARAMETERED_ELEMENT,
TemplateParameter.class, msgs);
if (newTemplateParameter != null)
msgs = ((InternalEObject) newTemplateParameter).eInverseAdd(
this, UMLPackage.TEMPLATE_PARAMETER__PARAMETERED_ELEMENT,
TemplateParameter.class, msgs);
msgs = basicSetTemplateParameter(newTemplateParameter, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER,
newTemplateParameter, newTemplateParameter));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateParameter getOwningTemplateParameter() {
if (eContainerFeatureID != UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER)
return null;
return (TemplateParameter) eContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public TemplateParameter basicGetOwningTemplateParameter() {
if (eContainerFeatureID != UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER)
return null;
return (TemplateParameter) eInternalContainer();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetOwningTemplateParameter(
TemplateParameter newOwningTemplateParameter, NotificationChain msgs) {
msgs = eBasicSetContainer((InternalEObject) newOwningTemplateParameter,
UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER, msgs);
Resource.Internal eInternalResource = eInternalResource();
if (eInternalResource == null || !eInternalResource.isLoading()) {
if (newOwningTemplateParameter != null) {
if (newOwningTemplateParameter != templateParameter) {
setTemplateParameter(newOwningTemplateParameter);
}
}
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setOwningTemplateParameter(
TemplateParameter newOwningTemplateParameter) {
if (newOwningTemplateParameter != eInternalContainer()
|| (eContainerFeatureID != UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER && newOwningTemplateParameter != null)) {
if (EcoreUtil.isAncestor(this, newOwningTemplateParameter))
throw new IllegalArgumentException(
"Recursive containment not allowed for " + toString()); //$NON-NLS-1$
NotificationChain msgs = null;
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
if (newOwningTemplateParameter != null)
msgs = ((InternalEObject) newOwningTemplateParameter)
.eInverseAdd(
this,
UMLPackage.TEMPLATE_PARAMETER__OWNED_PARAMETERED_ELEMENT,
TemplateParameter.class, msgs);
msgs = basicSetOwningTemplateParameter(newOwningTemplateParameter,
msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER,
newOwningTemplateParameter, newOwningTemplateParameter));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public VisibilityKind getVisibility() {
return visibility;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setVisibility(VisibilityKind newVisibility) {
VisibilityKind oldVisibility = visibility;
visibility = newVisibility == null
? VISIBILITY_EDEFAULT
: newVisibility;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.INSTANCE_SPECIFICATION__VISIBILITY, oldVisibility,
visibility));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isSetVisibility() {
return visibility != VISIBILITY_EDEFAULT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Element> getOwnedElements() {
CacheAdapter cache = getCacheAdapter();
if (cache != null) {
Resource eResource = eResource();
@SuppressWarnings("unchecked")
EList<Element> ownedElements = (EList<Element>) cache.get(
eResource, this, UMLPackage.Literals.ELEMENT__OWNED_ELEMENT);
if (ownedElements == null) {
cache.put(eResource, this,
UMLPackage.Literals.ELEMENT__OWNED_ELEMENT,
ownedElements = new DerivedUnionEObjectEList<Element>(
Element.class, this,
UMLPackage.INSTANCE_SPECIFICATION__OWNED_ELEMENT,
OWNED_ELEMENT_ESUBSETS));
}
return ownedElements;
}
return new DerivedUnionEObjectEList<Element>(Element.class, this,
UMLPackage.INSTANCE_SPECIFICATION__OWNED_ELEMENT,
OWNED_ELEMENT_ESUBSETS);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Classifier> getClassifiers() {
if (classifiers == null) {
classifiers = new EObjectResolvingEList<Classifier>(
Classifier.class, this,
UMLPackage.INSTANCE_SPECIFICATION__CLASSIFIER);
}
return classifiers;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Classifier getClassifier(String name) {
return getClassifier(name, false, null);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Classifier getClassifier(String name, boolean ignoreCase,
EClass eClass) {
classifierLoop : for (Classifier classifier : getClassifiers()) {
if (eClass != null && !eClass.isInstance(classifier))
continue classifierLoop;
if (name != null && !(ignoreCase
? name.equalsIgnoreCase(classifier.getName())
: name.equals(classifier.getName())))
continue classifierLoop;
return classifier;
}
return null;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ValueSpecification getSpecification() {
if (specification != null && specification.eIsProxy()) {
InternalEObject oldSpecification = (InternalEObject) specification;
specification = (ValueSpecification) eResolveProxy(oldSpecification);
if (specification != oldSpecification) {
InternalEObject newSpecification = (InternalEObject) specification;
NotificationChain msgs = oldSpecification.eInverseRemove(this,
EOPPOSITE_FEATURE_BASE
- UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION,
null, null);
if (newSpecification.eInternalContainer() == null) {
msgs = newSpecification.eInverseAdd(this,
EOPPOSITE_FEATURE_BASE
- UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION,
null, msgs);
}
if (msgs != null)
msgs.dispatch();
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE,
UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION,
oldSpecification, specification));
}
}
return specification;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ValueSpecification basicGetSpecification() {
return specification;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSpecification(
ValueSpecification newSpecification, NotificationChain msgs) {
ValueSpecification oldSpecification = specification;
specification = newSpecification;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this,
Notification.SET,
UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION,
oldSpecification, newSpecification);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSpecification(ValueSpecification newSpecification) {
if (newSpecification != specification) {
NotificationChain msgs = null;
if (specification != null)
msgs = ((InternalEObject) specification).eInverseRemove(this,
EOPPOSITE_FEATURE_BASE
- UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION,
null, msgs);
if (newSpecification != null)
msgs = ((InternalEObject) newSpecification).eInverseAdd(this,
EOPPOSITE_FEATURE_BASE
- UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION,
null, msgs);
msgs = basicSetSpecification(newSpecification, msgs);
if (msgs != null)
msgs.dispatch();
} else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION,
newSpecification, newSpecification));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ValueSpecification createSpecification(String name, Type type,
EClass eClass) {
ValueSpecification newSpecification = (ValueSpecification) create(eClass);
setSpecification(newSpecification);
if (name != null)
newSpecification.setName(name);
if (type != null)
newSpecification.setType(type);
return newSpecification;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<Slot> getSlots() {
if (slots == null) {
slots = new EObjectContainmentWithInverseEList.Resolving<Slot>(
Slot.class, this, UMLPackage.INSTANCE_SPECIFICATION__SLOT,
UMLPackage.SLOT__OWNING_INSTANCE);
}
return slots;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Slot createSlot() {
Slot newSlot = (Slot) create(UMLPackage.Literals.SLOT);
getSlots().add(newSlot);
return newSlot;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isCompatibleWith(ParameterableElement p) {
return ParameterableElementOperations.isCompatibleWith(this, p);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isTemplateParameter() {
return ParameterableElementOperations.isTemplateParameter(this);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateDefiningFeature(DiagnosticChain diagnostics,
Map<Object, Object> context) {
return InstanceSpecificationOperations.validateDefiningFeature(this,
diagnostics, context);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateStructuralFeature(DiagnosticChain diagnostics,
Map<Object, Object> context) {
return InstanceSpecificationOperations.validateStructuralFeature(this,
diagnostics, context);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateDeploymentTarget(DiagnosticChain diagnostics,
Map<Object, Object> context) {
return InstanceSpecificationOperations.validateDeploymentTarget(this,
diagnostics, context);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateDeploymentArtifact(DiagnosticChain diagnostics,
Map<Object, Object> context) {
return InstanceSpecificationOperations.validateDeploymentArtifact(this,
diagnostics, context);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case UMLPackage.INSTANCE_SPECIFICATION__EANNOTATIONS :
return ((InternalEList<InternalEObject>) (InternalEList<?>) getEAnnotations())
.basicAdd(otherEnd, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__CLIENT_DEPENDENCY :
return ((InternalEList<InternalEObject>) (InternalEList<?>) getClientDependencies())
.basicAdd(otherEnd, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__DEPLOYMENT :
return ((InternalEList<InternalEObject>) (InternalEList<?>) getDeployments())
.basicAdd(otherEnd, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER :
if (eInternalContainer() != null)
msgs = eBasicRemoveFromContainer(msgs);
return basicSetOwningTemplateParameter(
(TemplateParameter) otherEnd, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER :
if (templateParameter != null)
msgs = ((InternalEObject) templateParameter)
.eInverseRemove(this,
UMLPackage.TEMPLATE_PARAMETER__PARAMETERED_ELEMENT,
TemplateParameter.class, msgs);
return basicSetTemplateParameter((TemplateParameter) otherEnd,
msgs);
case UMLPackage.INSTANCE_SPECIFICATION__SLOT :
return ((InternalEList<InternalEObject>) (InternalEList<?>) getSlots())
.basicAdd(otherEnd, msgs);
}
return eDynamicInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd,
int featureID, NotificationChain msgs) {
switch (featureID) {
case UMLPackage.INSTANCE_SPECIFICATION__EANNOTATIONS :
return ((InternalEList<?>) getEAnnotations()).basicRemove(
otherEnd, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__OWNED_COMMENT :
return ((InternalEList<?>) getOwnedComments()).basicRemove(
otherEnd, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__CLIENT_DEPENDENCY :
return ((InternalEList<?>) getClientDependencies())
.basicRemove(otherEnd, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__NAME_EXPRESSION :
return basicSetNameExpression(null, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__DEPLOYMENT :
return ((InternalEList<?>) getDeployments()).basicRemove(
otherEnd, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER :
return basicSetOwningTemplateParameter(null, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER :
return basicSetTemplateParameter(null, msgs);
case UMLPackage.INSTANCE_SPECIFICATION__SLOT :
return ((InternalEList<?>) getSlots()).basicRemove(otherEnd,
msgs);
case UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION :
return basicSetSpecification(null, msgs);
}
return eDynamicInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eBasicRemoveFromContainerFeature(
NotificationChain msgs) {
switch (eContainerFeatureID) {
case UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER :
return eInternalContainer().eInverseRemove(this,
UMLPackage.TEMPLATE_PARAMETER__OWNED_PARAMETERED_ELEMENT,
TemplateParameter.class, msgs);
}
return eDynamicBasicRemoveFromContainer(msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case UMLPackage.INSTANCE_SPECIFICATION__EANNOTATIONS :
return getEAnnotations();
case UMLPackage.INSTANCE_SPECIFICATION__OWNED_ELEMENT :
return getOwnedElements();
case UMLPackage.INSTANCE_SPECIFICATION__OWNER :
if (resolve)
return getOwner();
return basicGetOwner();
case UMLPackage.INSTANCE_SPECIFICATION__OWNED_COMMENT :
return getOwnedComments();
case UMLPackage.INSTANCE_SPECIFICATION__NAME :
return getName();
case UMLPackage.INSTANCE_SPECIFICATION__VISIBILITY :
return getVisibility();
case UMLPackage.INSTANCE_SPECIFICATION__QUALIFIED_NAME :
return getQualifiedName();
case UMLPackage.INSTANCE_SPECIFICATION__CLIENT_DEPENDENCY :
return getClientDependencies();
case UMLPackage.INSTANCE_SPECIFICATION__NAMESPACE :
if (resolve)
return getNamespace();
return basicGetNamespace();
case UMLPackage.INSTANCE_SPECIFICATION__NAME_EXPRESSION :
if (resolve)
return getNameExpression();
return basicGetNameExpression();
case UMLPackage.INSTANCE_SPECIFICATION__DEPLOYMENT :
return getDeployments();
case UMLPackage.INSTANCE_SPECIFICATION__DEPLOYED_ELEMENT :
return getDeployedElements();
case UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER :
if (resolve)
return getOwningTemplateParameter();
return basicGetOwningTemplateParameter();
case UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER :
if (resolve)
return getTemplateParameter();
return basicGetTemplateParameter();
case UMLPackage.INSTANCE_SPECIFICATION__CLASSIFIER :
return getClassifiers();
case UMLPackage.INSTANCE_SPECIFICATION__SLOT :
return getSlots();
case UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION :
if (resolve)
return getSpecification();
return basicGetSpecification();
}
return eDynamicGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case UMLPackage.INSTANCE_SPECIFICATION__EANNOTATIONS :
getEAnnotations().clear();
getEAnnotations().addAll(
(Collection<? extends EAnnotation>) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__OWNED_COMMENT :
getOwnedComments().clear();
getOwnedComments().addAll(
(Collection<? extends Comment>) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__NAME :
setName((String) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__VISIBILITY :
setVisibility((VisibilityKind) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__CLIENT_DEPENDENCY :
getClientDependencies().clear();
getClientDependencies().addAll(
(Collection<? extends Dependency>) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__NAME_EXPRESSION :
setNameExpression((StringExpression) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__DEPLOYMENT :
getDeployments().clear();
getDeployments().addAll(
(Collection<? extends Deployment>) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER :
setOwningTemplateParameter((TemplateParameter) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER :
setTemplateParameter((TemplateParameter) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__CLASSIFIER :
getClassifiers().clear();
getClassifiers().addAll(
(Collection<? extends Classifier>) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__SLOT :
getSlots().clear();
getSlots().addAll((Collection<? extends Slot>) newValue);
return;
case UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION :
setSpecification((ValueSpecification) newValue);
return;
}
eDynamicSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case UMLPackage.INSTANCE_SPECIFICATION__EANNOTATIONS :
getEAnnotations().clear();
return;
case UMLPackage.INSTANCE_SPECIFICATION__OWNED_COMMENT :
getOwnedComments().clear();
return;
case UMLPackage.INSTANCE_SPECIFICATION__NAME :
unsetName();
return;
case UMLPackage.INSTANCE_SPECIFICATION__VISIBILITY :
unsetVisibility();
return;
case UMLPackage.INSTANCE_SPECIFICATION__CLIENT_DEPENDENCY :
getClientDependencies().clear();
return;
case UMLPackage.INSTANCE_SPECIFICATION__NAME_EXPRESSION :
setNameExpression((StringExpression) null);
return;
case UMLPackage.INSTANCE_SPECIFICATION__DEPLOYMENT :
getDeployments().clear();
return;
case UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER :
setOwningTemplateParameter((TemplateParameter) null);
return;
case UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER :
setTemplateParameter((TemplateParameter) null);
return;
case UMLPackage.INSTANCE_SPECIFICATION__CLASSIFIER :
getClassifiers().clear();
return;
case UMLPackage.INSTANCE_SPECIFICATION__SLOT :
getSlots().clear();
return;
case UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION :
setSpecification((ValueSpecification) null);
return;
}
eDynamicUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case UMLPackage.INSTANCE_SPECIFICATION__EANNOTATIONS :
return eAnnotations != null && !eAnnotations.isEmpty();
case UMLPackage.INSTANCE_SPECIFICATION__OWNED_ELEMENT :
return isSetOwnedElements();
case UMLPackage.INSTANCE_SPECIFICATION__OWNER :
return isSetOwner();
case UMLPackage.INSTANCE_SPECIFICATION__OWNED_COMMENT :
return ownedComments != null && !ownedComments.isEmpty();
case UMLPackage.INSTANCE_SPECIFICATION__NAME :
return isSetName();
case UMLPackage.INSTANCE_SPECIFICATION__VISIBILITY :
return isSetVisibility();
case UMLPackage.INSTANCE_SPECIFICATION__QUALIFIED_NAME :
return QUALIFIED_NAME_EDEFAULT == null
? getQualifiedName() != null
: !QUALIFIED_NAME_EDEFAULT.equals(getQualifiedName());
case UMLPackage.INSTANCE_SPECIFICATION__CLIENT_DEPENDENCY :
return clientDependencies != null
&& !clientDependencies.isEmpty();
case UMLPackage.INSTANCE_SPECIFICATION__NAMESPACE :
return isSetNamespace();
case UMLPackage.INSTANCE_SPECIFICATION__NAME_EXPRESSION :
return nameExpression != null;
case UMLPackage.INSTANCE_SPECIFICATION__DEPLOYMENT :
return deployments != null && !deployments.isEmpty();
case UMLPackage.INSTANCE_SPECIFICATION__DEPLOYED_ELEMENT :
return !getDeployedElements().isEmpty();
case UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER :
return basicGetOwningTemplateParameter() != null;
case UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER :
return templateParameter != null;
case UMLPackage.INSTANCE_SPECIFICATION__CLASSIFIER :
return classifiers != null && !classifiers.isEmpty();
case UMLPackage.INSTANCE_SPECIFICATION__SLOT :
return slots != null && !slots.isEmpty();
case UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION :
return specification != null;
}
return eDynamicIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) {
if (baseClass == ParameterableElement.class) {
switch (derivedFeatureID) {
case UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER :
return UMLPackage.PARAMETERABLE_ELEMENT__OWNING_TEMPLATE_PARAMETER;
case UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER :
return UMLPackage.PARAMETERABLE_ELEMENT__TEMPLATE_PARAMETER;
default :
return -1;
}
}
if (baseClass == PackageableElement.class) {
switch (derivedFeatureID) {
default :
return -1;
}
}
if (baseClass == DeployedArtifact.class) {
switch (derivedFeatureID) {
default :
return -1;
}
}
return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) {
if (baseClass == ParameterableElement.class) {
switch (baseFeatureID) {
case UMLPackage.PARAMETERABLE_ELEMENT__OWNING_TEMPLATE_PARAMETER :
return UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER;
case UMLPackage.PARAMETERABLE_ELEMENT__TEMPLATE_PARAMETER :
return UMLPackage.INSTANCE_SPECIFICATION__TEMPLATE_PARAMETER;
default :
return -1;
}
}
if (baseClass == PackageableElement.class) {
switch (baseFeatureID) {
default :
return -1;
}
}
if (baseClass == DeployedArtifact.class) {
switch (baseFeatureID) {
default :
return -1;
}
}
return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy())
return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (visibility: "); //$NON-NLS-1$
result.append(visibility);
result.append(')');
return result.toString();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Element basicGetOwner() {
TemplateParameter owningTemplateParameter = basicGetOwningTemplateParameter();
if (owningTemplateParameter != null) {
return owningTemplateParameter;
}
return super.basicGetOwner();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean isSetOwner() {
return super.isSetOwner()
|| eIsSet(UMLPackage.INSTANCE_SPECIFICATION__OWNING_TEMPLATE_PARAMETER);
}
/**
* The array of subset feature identifiers for the '{@link #getOwnedElements() <em>Owned Element</em>}' reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getOwnedElements()
* @generated
* @ordered
*/
protected static final int[] OWNED_ELEMENT_ESUBSETS = new int[]{
UMLPackage.INSTANCE_SPECIFICATION__OWNED_COMMENT,
UMLPackage.INSTANCE_SPECIFICATION__NAME_EXPRESSION,
UMLPackage.INSTANCE_SPECIFICATION__DEPLOYMENT,
UMLPackage.INSTANCE_SPECIFICATION__SLOT,
UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION};
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean isSetOwnedElements() {
return super.isSetOwnedElements()
|| eIsSet(UMLPackage.INSTANCE_SPECIFICATION__SLOT)
|| eIsSet(UMLPackage.INSTANCE_SPECIFICATION__SPECIFICATION);
}
} //InstanceSpecificationImpl