/** | |
* * Copyright (c) 2008 Daniel Varro | |
* * 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: | |
* * Daniel Varro - initial API and implementation | |
* | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.viatra2.gtasm.typerules.impl; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.viatra2.gtasm.typerules.BinaryTypeJudgement; | |
import org.eclipse.viatra2.gtasm.typerules.TyperulesPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>Binary Type Judgement</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.viatra2.gtasm.typerules.impl.BinaryTypeJudgementImpl#getFirstOperand <em>First Operand</em>}</li> | |
* <li>{@link org.eclipse.viatra2.gtasm.typerules.impl.BinaryTypeJudgementImpl#getSecondOperand <em>Second Operand</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class BinaryTypeJudgementImpl extends TypeJudgementImpl implements BinaryTypeJudgement { | |
/** | |
* The default value of the '{@link #getFirstOperand() <em>First Operand</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getFirstOperand() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String FIRST_OPERAND_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getFirstOperand() <em>First Operand</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getFirstOperand() | |
* @generated | |
* @ordered | |
*/ | |
protected String firstOperand = FIRST_OPERAND_EDEFAULT; | |
/** | |
* The default value of the '{@link #getSecondOperand() <em>Second Operand</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getSecondOperand() | |
* @generated | |
* @ordered | |
*/ | |
protected static final String SECOND_OPERAND_EDEFAULT = null; | |
/** | |
* The cached value of the '{@link #getSecondOperand() <em>Second Operand</em>}' attribute. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getSecondOperand() | |
* @generated | |
* @ordered | |
*/ | |
protected String secondOperand = SECOND_OPERAND_EDEFAULT; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected BinaryTypeJudgementImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return TyperulesPackage.Literals.BINARY_TYPE_JUDGEMENT; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getFirstOperand() { | |
return firstOperand; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setFirstOperand(String newFirstOperand) { | |
String oldFirstOperand = firstOperand; | |
firstOperand = newFirstOperand; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, TyperulesPackage.BINARY_TYPE_JUDGEMENT__FIRST_OPERAND, oldFirstOperand, firstOperand)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public String getSecondOperand() { | |
return secondOperand; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setSecondOperand(String newSecondOperand) { | |
String oldSecondOperand = secondOperand; | |
secondOperand = newSecondOperand; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, TyperulesPackage.BINARY_TYPE_JUDGEMENT__SECOND_OPERAND, oldSecondOperand, secondOperand)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case TyperulesPackage.BINARY_TYPE_JUDGEMENT__FIRST_OPERAND: | |
return getFirstOperand(); | |
case TyperulesPackage.BINARY_TYPE_JUDGEMENT__SECOND_OPERAND: | |
return getSecondOperand(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case TyperulesPackage.BINARY_TYPE_JUDGEMENT__FIRST_OPERAND: | |
setFirstOperand((String)newValue); | |
return; | |
case TyperulesPackage.BINARY_TYPE_JUDGEMENT__SECOND_OPERAND: | |
setSecondOperand((String)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case TyperulesPackage.BINARY_TYPE_JUDGEMENT__FIRST_OPERAND: | |
setFirstOperand(FIRST_OPERAND_EDEFAULT); | |
return; | |
case TyperulesPackage.BINARY_TYPE_JUDGEMENT__SECOND_OPERAND: | |
setSecondOperand(SECOND_OPERAND_EDEFAULT); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case TyperulesPackage.BINARY_TYPE_JUDGEMENT__FIRST_OPERAND: | |
return FIRST_OPERAND_EDEFAULT == null ? firstOperand != null : !FIRST_OPERAND_EDEFAULT.equals(firstOperand); | |
case TyperulesPackage.BINARY_TYPE_JUDGEMENT__SECOND_OPERAND: | |
return SECOND_OPERAND_EDEFAULT == null ? secondOperand != null : !SECOND_OPERAND_EDEFAULT.equals(secondOperand); | |
} | |
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(" (firstOperand: "); | |
result.append(firstOperand); | |
result.append(", secondOperand: "); | |
result.append(secondOperand); | |
result.append(')'); | |
return result.toString(); | |
} | |
} //BinaryTypeJudgementImpl |