org.openxma.dsl.dom.model.impl.OneToManyImpl Maven / Gradle / Ivy
/**
*
*
*
* $Id: OneToManyImpl.java 10224 2013-01-04 15:48:48Z dschwarz $
*/
package org.openxma.dsl.dom.model.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.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.openxma.dsl.dom.DomPackage;
import org.openxma.dsl.dom.model.Column;
import org.openxma.dsl.dom.model.OneToMany;
/**
*
* An implementation of the model object 'One To Many'.
*
*
* The following features are implemented:
*
* - {@link org.openxma.dsl.dom.model.impl.OneToManyImpl#getColumnName Column Name}
* - {@link org.openxma.dsl.dom.model.impl.OneToManyImpl#getColumns Columns}
*
*
*
* @generated
*/
public class OneToManyImpl extends DaoFeatureImpl implements OneToMany {
/**
* The default value of the '{@link #getColumnName() Column Name}' attribute.
*
*
* @see #getColumnName()
* @generated
* @ordered
*/
protected static final String COLUMN_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getColumnName() Column Name}' attribute.
*
*
* @see #getColumnName()
* @generated
* @ordered
*/
protected String columnName = COLUMN_NAME_EDEFAULT;
/**
* The cached value of the '{@link #getColumns() Columns}' containment reference list.
*
*
* @see #getColumns()
* @generated
* @ordered
*/
protected EList columns;
/**
*
*
* @generated
*/
protected OneToManyImpl() {
super();
}
/**
*
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return DomPackage.Literals.ONE_TO_MANY;
}
/**
*
*
* @generated
*/
public String getColumnName() {
return columnName;
}
/**
*
*
* @generated
*/
public void setColumnName(String newColumnName) {
String oldColumnName = columnName;
columnName = newColumnName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DomPackage.ONE_TO_MANY__COLUMN_NAME, oldColumnName, columnName));
}
/**
*
*
* @generated
*/
public EList getColumns() {
if (columns == null) {
columns = new EObjectContainmentEList(Column.class, this, DomPackage.ONE_TO_MANY__COLUMNS);
}
return columns;
}
/**
*
*
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DomPackage.ONE_TO_MANY__COLUMNS:
return ((InternalEList>)getColumns()).basicRemove(otherEnd, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
*
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DomPackage.ONE_TO_MANY__COLUMN_NAME:
return getColumnName();
case DomPackage.ONE_TO_MANY__COLUMNS:
return getColumns();
}
return super.eGet(featureID, resolve, coreType);
}
/**
*
*
* @generated
*/
@SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DomPackage.ONE_TO_MANY__COLUMN_NAME:
setColumnName((String)newValue);
return;
case DomPackage.ONE_TO_MANY__COLUMNS:
getColumns().clear();
getColumns().addAll((Collection extends Column>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
*
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DomPackage.ONE_TO_MANY__COLUMN_NAME:
setColumnName(COLUMN_NAME_EDEFAULT);
return;
case DomPackage.ONE_TO_MANY__COLUMNS:
getColumns().clear();
return;
}
super.eUnset(featureID);
}
/**
*
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DomPackage.ONE_TO_MANY__COLUMN_NAME:
return COLUMN_NAME_EDEFAULT == null ? columnName != null : !COLUMN_NAME_EDEFAULT.equals(columnName);
case DomPackage.ONE_TO_MANY__COLUMNS:
return columns != null && !columns.isEmpty();
}
return super.eIsSet(featureID);
}
/**
*
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (columnName: ");
result.append(columnName);
result.append(')');
return result.toString();
}
} //OneToManyImpl