Slide 21
Slide 21 text
Observers and Observables
package myModel.impl;
public class CourseImpl extends MinimalEObjectImpl.Container implements Course {
protected static final String NAME_EDEFAULT = null;
protected String name = NAME_EDEFAULT;
protected EList students;
protected CourseImpl() {
super();
}
@Override
protected EClass eStaticClass() {
return MyModelPackage.Literals.COURSE;
}
@Override
public String getName() {
return name;
}
@Override
public void setName(String newName) {
String oldName = name;
name = newName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, MyModelPackage.COURSE__NAME, oldName, name));
}
// continue ...
21