1 17 package org.eclipse.emf.ecore.util; 18 19 20 import org.eclipse.emf.common.notify.Notification; 21 import org.eclipse.emf.ecore.InternalEObject; 22 23 24 public class EObjectContainmentWithInverseEList extends EObjectContainmentEList 25 { 26 public static class Unsettable extends EObjectContainmentWithInverseEList 27 { 28 protected boolean isSet; 29 30 public Unsettable(Class dataClass, InternalEObject owner, int featureID, int inverseFeatureID) 31 { 32 super(dataClass, owner, featureID, inverseFeatureID); 33 } 34 35 protected void didChange() 36 { 37 isSet = true; 38 } 39 40 public boolean isSet() 41 { 42 return isSet; 43 } 44 45 public void unset() 46 { 47 super.unset(); 48 if (isNotificationRequired()) 49 { 50 boolean oldIsSet = isSet; 51 isSet = false; 52 owner.eNotify(createNotification(Notification.UNSET, oldIsSet, false)); 53 } 54 else 55 { 56 isSet = false; 57 } 58 } 59 } 60 61 protected final int inverseFeatureID; 62 63 public EObjectContainmentWithInverseEList 64 (Class dataClass, InternalEObject owner, int featureID, int inverseFeatureID) 65 { 66 super(dataClass, owner, featureID); 67 this.inverseFeatureID = inverseFeatureID; 68 } 69 70 protected boolean hasNavigableInverse() 71 { 72 return true; 73 } 74 75 public int getInverseFeatureID() 76 { 77 return inverseFeatureID; 78 } 79 80 public Class getInverseFeatureClass() 81 { 82 return dataClass; 83 } 84 } 85 | Popular Tags |