/** * Returns whether there are any adapters. * @return whether there are any adapters. */ protected boolean eBasicHasAdapters() { BasicEList<Adapter> eBasicAdapters = eBasicAdapters(); return eBasicAdapters != null && eBasicAdapters.size() != 0; }
public EStructuralFeature getEStructuralFeature(String name) { getFeatureCount(); if (eNameToFeatureMap == null) { Map<String, EStructuralFeature> result = new HashMap<String, EStructuralFeature>(3 * eAllStructuralFeatures.size() / 2 + 1); for (EStructuralFeature eStructuralFeature : eAllStructuralFeatures) { String key = eStructuralFeature.getName(); EStructuralFeature duplicate = result.put(key, eStructuralFeature); if (duplicate != null) { result.put(key, duplicate); } } eNameToFeatureMap = result; } return eNameToFeatureMap.get(name); }
public EStructuralFeature getEStructuralFeature(String name) { getFeatureCount(); if (eNameToFeatureMap == null) { Map<String, EStructuralFeature> result = new HashMap<String, EStructuralFeature>(3 * eAllStructuralFeatures.size() / 2 + 1); for (EStructuralFeature eStructuralFeature : eAllStructuralFeatures) { String key = eStructuralFeature.getName(); EStructuralFeature duplicate = result.put(key, eStructuralFeature); if (duplicate != null) { result.put(key, duplicate); } } eNameToFeatureMap = result; } return eNameToFeatureMap.get(name); }
private void moveESetting(Object[] oldSettings, Object[] newSettings, int oldIndex, EStructuralFeature sf, int newIndex) { // See if single vs many. if (!sf.isMany()) newSettings[newIndex] = oldSettings[oldIndex]; // Great, we can just move it over. else { // Many is more difficult. Need to create a new dynamic list of right type, and // then just copy over the data from the old one. We create new one by doing a simple eGet. // This will construct an empty one with no notifications going out. // Note: This is extremelly implementation dependent. We will be throwing away the old // oldMany, so it is ok to reuse the actual array of data for the newMany. BasicEList newMany = (BasicEList) eGet(sf); BasicEList oldMany = (BasicEList) oldSettings[oldIndex]; newMany.setData(oldMany.size(), oldMany.data()); } }
/** * Checks for folder mappings to populate the {@link #prefixMaps prefix maps}. */ @Override protected void didAdd(Entry<URI, URI> entry) { if (((MappingEntryImpl)entry).isPrefixMapEntry) { int length = entry.getKey().segmentCount(); if (prefixMaps == null) { prefixMaps = new BasicEList<List<Entry<URI, URI>>>(); } for (int i = prefixMaps.size() - 1; i <= length; ++i) { prefixMaps.add(new BasicEList<Entry<URI, URI>>()); } prefixMaps.get(length).add(entry); } }
for (int i = Math.min(prefixMaps.size() - 1, uri.segmentCount()); i >= 0; --i)
for (int i = Math.min(prefixMaps.size() - 1, uri.segmentCount()); i >= 0; --i)
/** * Checks for folder mappings to populate the {@link #prefixMaps prefix maps}. */ @Override protected void didAdd(Entry<URI, URI> entry) { if (((MappingEntryImpl)entry).isPrefixMapEntry) { int length = entry.getKey().segmentCount(); if (prefixMaps == null) { prefixMaps = new BasicEList<List<Entry<URI, URI>>>(); } for (int i = prefixMaps.size() - 1; i <= length; ++i) { prefixMaps.add(new BasicEList<Entry<URI, URI>>()); } prefixMaps.get(length).add(entry); } }
public void remove(EObject eObject, EReference eReference, EObject crossReferencedEObject) { if (!resolve()) { removeProxy(crossReferencedEObject, eObject); } BasicEList<EStructuralFeature.Setting> collection = (BasicEList<EStructuralFeature.Setting>)get(crossReferencedEObject); if (collection != null) { EStructuralFeature.Setting [] settingData = (EStructuralFeature.Setting[])collection.data(); for (int i = 0, size = collection.size(); i < size; ++i) { EStructuralFeature.Setting setting = settingData[i]; if (setting.getEObject() == eObject && setting.getEStructuralFeature() == eReference) { if (collection.size() == 1) { super.remove(crossReferencedEObject); } else { collection.remove(i); } break; } } } }
public void remove(EObject eObject, EReference eReference, EObject crossReferencedEObject) { if (!resolve()) { removeProxy(crossReferencedEObject, eObject); } BasicEList<EStructuralFeature.Setting> collection = (BasicEList<EStructuralFeature.Setting>)get(crossReferencedEObject); if (collection != null) { EStructuralFeature.Setting [] settingData = (EStructuralFeature.Setting[])collection.data(); for (int i = 0, size = collection.size(); i < size; ++i) { EStructuralFeature.Setting setting = settingData[i]; if (setting.getEObject() == eObject && setting.getEStructuralFeature() == eReference) { if (collection.size() == 1) { super.remove(crossReferencedEObject); } else { collection.remove(i); } break; } } } }
int operationID = result.size(); for (Iterator<EOperation> i = getEOperations().iterator(); i.hasNext(); ++operationID) eAllOperations = new EcoreEList.UnmodifiableEList.FastCompare<EOperation> (this, EcorePackage.eINSTANCE.getEClass_EAllOperations(), result.size(), result.data()); eAllOperationsData = (EOperation[])result.data(); if (eAllOperationsData == null)
int operationID = result.size(); for (Iterator<EOperation> i = getEOperations().iterator(); i.hasNext(); ++operationID) eAllOperations = new EcoreEList.UnmodifiableEList.FastCompare<EOperation> (this, EcorePackage.eINSTANCE.getEClass_EAllOperations(), result.size(), result.data()); eAllOperationsData = (EOperation[])result.data(); if (eAllOperationsData == null)
eAllSuperTypes = new EcoreEList.UnmodifiableEList.FastCompare<EClass> (this, EcorePackage.eINSTANCE.getEClass_EAllSuperTypes(), result.size(), result.data()); getESuperAdapter().setAllSuperCollectionModified(false);
eReferences = new EcoreEList.UnmodifiableEList.FastCompare<EReference> (this, EcorePackage.eINSTANCE.getEClass_EReferences(), references.size(), references.data()) eAllReferences = new EcoreEList.UnmodifiableEList.FastCompare<EReference> (this, EcorePackage.eINSTANCE.getEClass_EAllReferences(), result.size(), result.data()); getESuperAdapter().setAllReferencesCollectionModified(false);
eAllSuperTypes = new EcoreEList.UnmodifiableEList.FastCompare<EClass> (this, EcorePackage.eINSTANCE.getEClass_EAllSuperTypes(), result.size(), result.data()); getESuperAdapter().setAllSuperCollectionModified(false);
eReferences = new EcoreEList.UnmodifiableEList.FastCompare<EReference> (this, EcorePackage.eINSTANCE.getEClass_EReferences(), references.size(), references.data()) eAllReferences = new EcoreEList.UnmodifiableEList.FastCompare<EReference> (this, EcorePackage.eINSTANCE.getEClass_EAllReferences(), result.size(), result.data()); getESuperAdapter().setAllReferencesCollectionModified(false);
eAttributes = new EcoreEList.UnmodifiableEList.FastCompare<EAttribute> (this, EcorePackage.eINSTANCE.getEClass_EAttributes(), attributes.size(), attributes.data()) eAllAttributes = new EcoreEList.UnmodifiableEList.FastCompare<EAttribute> (this, EcorePackage.eINSTANCE.getEClass_EAllAttributes(), result.size(), result.data()); getESuperAdapter().setAllAttributesCollectionModified(false);
eAttributes = new EcoreEList.UnmodifiableEList.FastCompare<EAttribute> (this, EcorePackage.eINSTANCE.getEClass_EAttributes(), attributes.size(), attributes.data()) eAllAttributes = new EcoreEList.UnmodifiableEList.FastCompare<EAttribute> (this, EcorePackage.eINSTANCE.getEClass_EAllAttributes(), result.size(), result.data()); getESuperAdapter().setAllAttributesCollectionModified(false);
eAllContainments = new EcoreEList.UnmodifiableEList.FastCompare<EReference> (this, EcorePackage.eINSTANCE.getEClass_EAllContainments(), result.size(), result.data()); getESuperAdapter().setAllContainmentsCollectionModified(false);
eAllContainments = new EcoreEList.UnmodifiableEList.FastCompare<EReference> (this, EcorePackage.eINSTANCE.getEClass_EAllContainments(), result.size(), result.data()); getESuperAdapter().setAllContainmentsCollectionModified(false);