blob: 865449edb9ea3cb236da23628100804e97816da6 [file] [log] [blame]
/**
*/
package org.eclipse.osbp.ecview.core.extension.model.extension.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.common.util.EMap;
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.impl.MinimalEObjectImpl;
import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
import org.eclipse.emf.ecore.util.EcoreEMap;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.osbp.ecview.core.common.model.core.CoreModelPackage;
import org.eclipse.osbp.ecview.core.common.model.core.impl.YStringToStringMapImpl;
import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage;
import org.eclipse.osbp.ecview.core.extension.model.extension.YSortColumn;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>YSort Column</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YSortColumnImpl#getTags <em>Tags</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YSortColumnImpl#getId <em>Id</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YSortColumnImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YSortColumnImpl#getProperties <em>Properties</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YSortColumnImpl#getPropertyPath <em>Property Path</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YSortColumnImpl#getType <em>Type</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YSortColumnImpl#getTypeQualifiedName <em>Type Qualified Name</em>}</li>
* <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YSortColumnImpl#isAsc <em>Asc</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class YSortColumnImpl extends MinimalEObjectImpl.Container implements YSortColumn {
/**
* The cached value of the '{@link #getTags() <em>Tags</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTags()
* @generated
* @ordered
*/
protected EList<String> tags;
/**
* The default value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected static final String ID_EDEFAULT = null;
/**
* The cached value of the '{@link #getId() <em>Id</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getId()
* @generated
* @ordered
*/
protected String id = ID_EDEFAULT;
/**
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected static final String NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getName()
* @generated
* @ordered
*/
protected String name = NAME_EDEFAULT;
/**
* The cached value of the '{@link #getProperties() <em>Properties</em>}' map.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getProperties()
* @generated
* @ordered
*/
protected EMap<String, String> properties;
/**
* The default value of the '{@link #getPropertyPath() <em>Property Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPropertyPath()
* @generated
* @ordered
*/
protected static final String PROPERTY_PATH_EDEFAULT = null;
/**
* The cached value of the '{@link #getPropertyPath() <em>Property Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPropertyPath()
* @generated
* @ordered
*/
protected String propertyPath = PROPERTY_PATH_EDEFAULT;
/**
* The cached value of the '{@link #getType() <em>Type</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getType()
* @generated
* @ordered
*/
protected Class<?> type;
/**
* The default value of the '{@link #getTypeQualifiedName() <em>Type Qualified Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTypeQualifiedName()
* @generated
* @ordered
*/
protected static final String TYPE_QUALIFIED_NAME_EDEFAULT = null;
/**
* The cached value of the '{@link #getTypeQualifiedName() <em>Type Qualified Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTypeQualifiedName()
* @generated
* @ordered
*/
protected String typeQualifiedName = TYPE_QUALIFIED_NAME_EDEFAULT;
/**
* The default value of the '{@link #isAsc() <em>Asc</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isAsc()
* @generated
* @ordered
*/
protected static final boolean ASC_EDEFAULT = true;
/**
* The cached value of the '{@link #isAsc() <em>Asc</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isAsc()
* @generated
* @ordered
*/
protected boolean asc = ASC_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected YSortColumnImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ExtensionModelPackage.Literals.YSORT_COLUMN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EList<String> getTags() {
if (tags == null) {
tags = new EDataTypeUniqueEList<String>(String.class, this, ExtensionModelPackage.YSORT_COLUMN__TAGS);
}
return tags;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getId() {
return id;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setId(String newId) {
String oldId = id;
id = newId;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YSORT_COLUMN__ID, oldId, id));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getName() {
return name;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YSORT_COLUMN__NAME, oldName, name));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EMap<String, String> getProperties() {
if (properties == null) {
properties = new EcoreEMap<String,String>(CoreModelPackage.Literals.YSTRING_TO_STRING_MAP, YStringToStringMapImpl.class, this, ExtensionModelPackage.YSORT_COLUMN__PROPERTIES);
}
return properties;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getPropertyPath() {
return propertyPath;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPropertyPath(String newPropertyPath) {
String oldPropertyPath = propertyPath;
propertyPath = newPropertyPath;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YSORT_COLUMN__PROPERTY_PATH, oldPropertyPath, propertyPath));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Class<?> getType() {
return type;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setType(Class<?> newType) {
Class<?> oldType = type;
type = newType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YSORT_COLUMN__TYPE, oldType, type));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getTypeQualifiedName() {
return typeQualifiedName;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTypeQualifiedName(String newTypeQualifiedName) {
String oldTypeQualifiedName = typeQualifiedName;
typeQualifiedName = newTypeQualifiedName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YSORT_COLUMN__TYPE_QUALIFIED_NAME, oldTypeQualifiedName, typeQualifiedName));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isAsc() {
return asc;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setAsc(boolean newAsc) {
boolean oldAsc = asc;
asc = newAsc;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YSORT_COLUMN__ASC, oldAsc, asc));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case ExtensionModelPackage.YSORT_COLUMN__PROPERTIES:
return ((InternalEList<?>)getProperties()).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 ExtensionModelPackage.YSORT_COLUMN__TAGS:
return getTags();
case ExtensionModelPackage.YSORT_COLUMN__ID:
return getId();
case ExtensionModelPackage.YSORT_COLUMN__NAME:
return getName();
case ExtensionModelPackage.YSORT_COLUMN__PROPERTIES:
if (coreType) return getProperties();
else return getProperties().map();
case ExtensionModelPackage.YSORT_COLUMN__PROPERTY_PATH:
return getPropertyPath();
case ExtensionModelPackage.YSORT_COLUMN__TYPE:
return getType();
case ExtensionModelPackage.YSORT_COLUMN__TYPE_QUALIFIED_NAME:
return getTypeQualifiedName();
case ExtensionModelPackage.YSORT_COLUMN__ASC:
return isAsc();
}
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 ExtensionModelPackage.YSORT_COLUMN__TAGS:
getTags().clear();
getTags().addAll((Collection<? extends String>)newValue);
return;
case ExtensionModelPackage.YSORT_COLUMN__ID:
setId((String)newValue);
return;
case ExtensionModelPackage.YSORT_COLUMN__NAME:
setName((String)newValue);
return;
case ExtensionModelPackage.YSORT_COLUMN__PROPERTIES:
((EStructuralFeature.Setting)getProperties()).set(newValue);
return;
case ExtensionModelPackage.YSORT_COLUMN__PROPERTY_PATH:
setPropertyPath((String)newValue);
return;
case ExtensionModelPackage.YSORT_COLUMN__TYPE:
setType((Class<?>)newValue);
return;
case ExtensionModelPackage.YSORT_COLUMN__TYPE_QUALIFIED_NAME:
setTypeQualifiedName((String)newValue);
return;
case ExtensionModelPackage.YSORT_COLUMN__ASC:
setAsc((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ExtensionModelPackage.YSORT_COLUMN__TAGS:
getTags().clear();
return;
case ExtensionModelPackage.YSORT_COLUMN__ID:
setId(ID_EDEFAULT);
return;
case ExtensionModelPackage.YSORT_COLUMN__NAME:
setName(NAME_EDEFAULT);
return;
case ExtensionModelPackage.YSORT_COLUMN__PROPERTIES:
getProperties().clear();
return;
case ExtensionModelPackage.YSORT_COLUMN__PROPERTY_PATH:
setPropertyPath(PROPERTY_PATH_EDEFAULT);
return;
case ExtensionModelPackage.YSORT_COLUMN__TYPE:
setType((Class<?>)null);
return;
case ExtensionModelPackage.YSORT_COLUMN__TYPE_QUALIFIED_NAME:
setTypeQualifiedName(TYPE_QUALIFIED_NAME_EDEFAULT);
return;
case ExtensionModelPackage.YSORT_COLUMN__ASC:
setAsc(ASC_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ExtensionModelPackage.YSORT_COLUMN__TAGS:
return tags != null && !tags.isEmpty();
case ExtensionModelPackage.YSORT_COLUMN__ID:
return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id);
case ExtensionModelPackage.YSORT_COLUMN__NAME:
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
case ExtensionModelPackage.YSORT_COLUMN__PROPERTIES:
return properties != null && !properties.isEmpty();
case ExtensionModelPackage.YSORT_COLUMN__PROPERTY_PATH:
return PROPERTY_PATH_EDEFAULT == null ? propertyPath != null : !PROPERTY_PATH_EDEFAULT.equals(propertyPath);
case ExtensionModelPackage.YSORT_COLUMN__TYPE:
return type != null;
case ExtensionModelPackage.YSORT_COLUMN__TYPE_QUALIFIED_NAME:
return TYPE_QUALIFIED_NAME_EDEFAULT == null ? typeQualifiedName != null : !TYPE_QUALIFIED_NAME_EDEFAULT.equals(typeQualifiedName);
case ExtensionModelPackage.YSORT_COLUMN__ASC:
return asc != ASC_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (tags: ");
result.append(tags);
result.append(", id: ");
result.append(id);
result.append(", name: ");
result.append(name);
result.append(", propertyPath: ");
result.append(propertyPath);
result.append(", type: ");
result.append(type);
result.append(", typeQualifiedName: ");
result.append(typeQualifiedName);
result.append(", asc: ");
result.append(asc);
result.append(')');
return result.toString();
}
} //YSortColumnImpl