/*******************************************************************************
* This file is protected by Copyright.
* Please refer to the COPYRIGHT file distributed with this source distribution.
*
* This file is part of REDHAWK IDE.
*
* 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
*******************************************************************************/
// BEGIN GENERATED CODE
package gov.redhawk.ide.snapshot.internal.ui.SnapshotMetaData.impl;
import gov.redhawk.ide.snapshot.internal.ui.SnapshotMetaData.CFDataType;
import gov.redhawk.ide.snapshot.internal.ui.SnapshotMetaData.KeywordsType;
import gov.redhawk.ide.snapshot.internal.ui.SnapshotMetaData.SnapshotMetadataPackage;
import java.util.Collection;
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.EObjectImpl;
import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Keywords Type</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link gov.redhawk.ide.snapshot.internal.ui.SnapshotMetaData.impl.KeywordsTypeImpl#getMixed <em>Mixed</em>}</li>
* <li>{@link gov.redhawk.ide.snapshot.internal.ui.SnapshotMetaData.impl.KeywordsTypeImpl#getCFDataType <em>CF Data Type</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class KeywordsTypeImpl extends EObjectImpl implements KeywordsType {
/**
* The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMixed()
* @generated
* @ordered
*/
protected FeatureMap mixed;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected KeywordsTypeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return SnapshotMetadataPackage.Literals.KEYWORDS_TYPE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public FeatureMap getMixed() {
if (mixed == null)
{
mixed = new BasicFeatureMap(this, SnapshotMetadataPackage.KEYWORDS_TYPE__MIXED);
}
return mixed;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public EList<CFDataType> getCFDataType() {
return getMixed().list(SnapshotMetadataPackage.Literals.KEYWORDS_TYPE__CF_DATA_TYPE);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID)
{
case SnapshotMetadataPackage.KEYWORDS_TYPE__MIXED:
return ((InternalEList<?>)getMixed()).basicRemove(otherEnd, msgs);
case SnapshotMetadataPackage.KEYWORDS_TYPE__CF_DATA_TYPE:
return ((InternalEList<?>)getCFDataType()).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 SnapshotMetadataPackage.KEYWORDS_TYPE__MIXED:
if (coreType) return getMixed();
return ((FeatureMap.Internal)getMixed()).getWrapper();
case SnapshotMetadataPackage.KEYWORDS_TYPE__CF_DATA_TYPE:
return getCFDataType();
}
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 SnapshotMetadataPackage.KEYWORDS_TYPE__MIXED:
((FeatureMap.Internal)getMixed()).set(newValue);
return;
case SnapshotMetadataPackage.KEYWORDS_TYPE__CF_DATA_TYPE:
getCFDataType().clear();
getCFDataType().addAll((Collection<? extends CFDataType>)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID)
{
case SnapshotMetadataPackage.KEYWORDS_TYPE__MIXED:
getMixed().clear();
return;
case SnapshotMetadataPackage.KEYWORDS_TYPE__CF_DATA_TYPE:
getCFDataType().clear();
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID)
{
case SnapshotMetadataPackage.KEYWORDS_TYPE__MIXED:
return mixed != null && !mixed.isEmpty();
case SnapshotMetadataPackage.KEYWORDS_TYPE__CF_DATA_TYPE:
return !getCFDataType().isEmpty();
}
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(" (mixed: ");
result.append(mixed);
result.append(')');
return result.toString();
}
} //KeywordsTypeImpl