blob: 2a292c9487d82be8b8459ec962f44f6c6e93f6e0 [file] [log] [blame]
/******************************************************************************
* Copyright (c) 2005 IBM Corporation and others.
* 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:
* IBM Corporation - initial API and implementation
****************************************************************************/
package org.eclipse.gmf.tests.runtime.emf.type.core.employee.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.gmf.tests.runtime.emf.type.core.employee.EmployeePackage;
import org.eclipse.gmf.tests.runtime.emf.type.core.employee.Student;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Student</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.gmf.tests.runtime.emf.type.core.employee.impl.StudentImpl#isCoop <em>Coop</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class StudentImpl extends EmployeeImpl implements Student {
/**
* The default value of the '{@link #isCoop() <em>Coop</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isCoop()
* @generated
* @ordered
*/
protected static final boolean COOP_EDEFAULT = false;
/**
* The flag representing the value of the '{@link #isCoop() <em>Coop</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isCoop()
* @generated
* @ordered
*/
protected static final int COOP_EFLAG = 1 << 10;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected StudentImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected EClass eStaticClass() {
return EmployeePackage.Literals.STUDENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isCoop() {
return (eFlags & COOP_EFLAG) != 0;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCoop(boolean newCoop) {
boolean oldCoop = (eFlags & COOP_EFLAG) != 0;
if (newCoop) eFlags |= COOP_EFLAG; else eFlags &= ~COOP_EFLAG;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, EmployeePackage.STUDENT__COOP, oldCoop, newCoop));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case EmployeePackage.STUDENT__COOP:
return isCoop() ? Boolean.TRUE : Boolean.FALSE;
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case EmployeePackage.STUDENT__COOP:
setCoop(((Boolean)newValue).booleanValue());
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void eUnset(int featureID) {
switch (featureID) {
case EmployeePackage.STUDENT__COOP:
setCoop(COOP_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean eIsSet(int featureID) {
switch (featureID) {
case EmployeePackage.STUDENT__COOP:
return ((eFlags & COOP_EFLAG) != 0) != COOP_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (coop: "); //$NON-NLS-1$
result.append((eFlags & COOP_EFLAG) != 0);
result.append(')');
return result.toString();
}
} //StudentImpl