/**
* <copyright>
*
* Copyright (c) 2010-2016 Thales Global Services S.A.S.
* 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:
* Thales Global Services S.A.S. - initial API and implementation
*
* </copyright>
*/
package org.eclipse.emf.diffmerge.ui.diffuidata.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.diffmerge.diffdata.EMatch;
import org.eclipse.emf.diffmerge.ui.diffuidata.DiffuidataPackage;
import org.eclipse.emf.diffmerge.ui.diffuidata.MatchAndFeature;
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.EObjectImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Match And Feature</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.diffmerge.ui.diffuidata.impl.MatchAndFeatureImpl#getMatch <em>Match</em>}</li>
* <li>{@link org.eclipse.emf.diffmerge.ui.diffuidata.impl.MatchAndFeatureImpl#getFeature <em>Feature</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class MatchAndFeatureImpl extends EObjectImpl implements MatchAndFeature {
/**
* The cached value of the '{@link #getMatch() <em>Match</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getMatch()
* @generated
* @ordered
*/
protected EMatch match;
/**
* The cached value of the '{@link #getFeature() <em>Feature</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFeature()
* @generated
* @ordered
*/
protected EStructuralFeature feature;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MatchAndFeatureImpl() {
super();
}
/**
* Constructor
* @param match_p a non-null match
* @param feature_p a non-null feature
* @generated NOT
*/
public MatchAndFeatureImpl(EMatch match_p, EStructuralFeature feature_p) {
match = match_p;
feature = feature_p;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DiffuidataPackage.Literals.MATCH_AND_FEATURE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EMatch getMatch() {
if (match != null && match.eIsProxy()) {
InternalEObject oldMatch = (InternalEObject)match;
match = (EMatch)eResolveProxy(oldMatch);
if (match != oldMatch) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiffuidataPackage.MATCH_AND_FEATURE__MATCH, oldMatch, match));
}
}
return match;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EMatch basicGetMatch() {
return match;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EStructuralFeature getFeature() {
if (feature != null && feature.eIsProxy()) {
InternalEObject oldFeature = (InternalEObject)feature;
feature = (EStructuralFeature)eResolveProxy(oldFeature);
if (feature != oldFeature) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiffuidataPackage.MATCH_AND_FEATURE__FEATURE, oldFeature, feature));
}
}
return feature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public EStructuralFeature basicGetFeature() {
return feature;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DiffuidataPackage.MATCH_AND_FEATURE__MATCH:
if (resolve) return getMatch();
return basicGetMatch();
case DiffuidataPackage.MATCH_AND_FEATURE__FEATURE:
if (resolve) return getFeature();
return basicGetFeature();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DiffuidataPackage.MATCH_AND_FEATURE__MATCH:
return match != null;
case DiffuidataPackage.MATCH_AND_FEATURE__FEATURE:
return feature != null;
}
return super.eIsSet(featureID);
}
} //MatchAndFeatureImpl