/** | |
* Copyright (c) 2018 CEA LIST. | |
* | |
* 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: | |
* Arnault Lapitre (CEA LIST) arnault.lapitre@cea.fr | |
* - Initial API and Implementation | |
*/ | |
package org.eclipse.efm.ecore.formalml.datatype.impl; | |
import java.util.Collection; | |
import org.eclipse.efm.ecore.formalml.datatype.DataStructuredType; | |
import org.eclipse.efm.ecore.formalml.datatype.DatatypePackage; | |
import org.eclipse.efm.ecore.formalml.infrastructure.PropertyDefinition; | |
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.InternalEObject; | |
import org.eclipse.emf.ecore.util.EObjectContainmentEList; | |
import org.eclipse.emf.ecore.util.InternalEList; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Data Structured Type</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* </p> | |
* <ul> | |
* <li>{@link org.eclipse.efm.ecore.formalml.datatype.impl.DataStructuredTypeImpl#getProperty <em>Property</em>}</li> | |
* </ul> | |
* | |
* @generated | |
*/ | |
public abstract class DataStructuredTypeImpl extends DataTypeImpl implements DataStructuredType { | |
/** | |
* The cached value of the '{@link #getProperty() <em>Property</em>}' containment reference list. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getProperty() | |
* @generated | |
* @ordered | |
*/ | |
protected EList<PropertyDefinition> property; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected DataStructuredTypeImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return DatatypePackage.Literals.DATA_STRUCTURED_TYPE; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public EList<PropertyDefinition> getProperty() { | |
if (property == null) { | |
property = new EObjectContainmentEList<PropertyDefinition>(PropertyDefinition.class, this, DatatypePackage.DATA_STRUCTURED_TYPE__PROPERTY); | |
} | |
return property; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | |
switch (featureID) { | |
case DatatypePackage.DATA_STRUCTURED_TYPE__PROPERTY: | |
return ((InternalEList<?>)getProperty()).basicRemove(otherEnd, msgs); | |
} | |
return super.eInverseRemove(otherEnd, featureID, msgs); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case DatatypePackage.DATA_STRUCTURED_TYPE__PROPERTY: | |
return getProperty(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@SuppressWarnings("unchecked") | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case DatatypePackage.DATA_STRUCTURED_TYPE__PROPERTY: | |
getProperty().clear(); | |
getProperty().addAll((Collection<? extends PropertyDefinition>)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case DatatypePackage.DATA_STRUCTURED_TYPE__PROPERTY: | |
getProperty().clear(); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case DatatypePackage.DATA_STRUCTURED_TYPE__PROPERTY: | |
return property != null && !property.isEmpty(); | |
} | |
return super.eIsSet(featureID); | |
} | |
} //DataStructuredTypeImpl |