public Object get(EObject eObject, Object key) { return get(null, eObject, key); }
public Object put(EObject eObject, Object key, Object value) { return put(null, eObject, key, value); }
private static CacheAdapter createCacheAdapter() { CacheAdapter cacheAdapter = UML2Util .loadClassFromSystemProperty("org.eclipse.uml2.common.util.CacheAdapter.INSTANCE"); //$NON-NLS-1$ if (cacheAdapter != null) { return cacheAdapter; } return new CacheAdapter(); }
public Object put(Resource resource, EObject eObject, Object key, Object value) { if (key == null) { throw new IllegalArgumentException(String.valueOf(key)); } if (resource != null) { addAdapter(resource); } Map<EObject, Map<Object, Object>> resourceMap = values.get(resource); if (resourceMap == null) { resourceMap = Collections.synchronizedMap(this .<EObject, Map<Object, Object>> createHashMap()); values.put(resource, resourceMap); } Map<Object, Object> eObjectMap = resourceMap.get(eObject); if (eObjectMap == null) { eObjectMap = Collections.synchronizedMap(this .<Object, Object> createHashMap()); resourceMap.put(eObject, eObjectMap); } return eObjectMap.put(key, value); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<Type> getEndTypes() { CacheAdapter cache = getCacheAdapter(); if (cache != null) { @SuppressWarnings("unchecked") EList<Type> result = (EList<Type>) cache.get(this, UMLPackage.Literals.ASSOCIATION__END_TYPE); if (result == null) { cache.put(this, UMLPackage.Literals.ASSOCIATION__END_TYPE, result = AssociationOperations.getEndTypes(this)); } return result; } return AssociationOperations.getEndTypes(this); }
@Override public Collection<EStructuralFeature.Setting> getInverseReferences( EObject eObject) { addAdapter(eObject); return super.getInverseReferences(eObject); }
@Override protected void unsetTarget(Resource target) { super.unsetTarget(target); clear(target); }
public boolean containsKey(EObject eObject, Object key) { return containsKey(null, eObject, key); }
.<EObject, Resource> createHashMap());
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<Association> getAssociations() { CacheAdapter cache = getCacheAdapter(); if (cache != null) { @SuppressWarnings("unchecked") EList<Association> result = (EList<Association>) cache.get(this, UMLPackage.Literals.TYPE___GET_ASSOCIATIONS); if (result == null) { cache.put(this, UMLPackage.Literals.TYPE___GET_ASSOCIATIONS, result = TypeOperations.getAssociations(this)); } return result; } return TypeOperations.getAssociations(this); }
public Object put(Resource resource, EObject eObject, Object key, Object value) { if (key == null) { throw new IllegalArgumentException(String.valueOf(key)); } if (resource != null) { addAdapter(resource); } Map<EObject, Map<Object, Object>> resourceMap = values.get(resource); if (resourceMap == null) { resourceMap = Collections.synchronizedMap(this .<EObject, Map<Object, Object>> createHashMap()); values.put(resource, resourceMap); } Map<Object, Object> eObjectMap = resourceMap.get(eObject); if (eObjectMap == null) { eObjectMap = Collections.synchronizedMap(this .<Object, Object> createHashMap()); resourceMap.put(eObject, eObjectMap); } return eObjectMap.put(key, value); }
public boolean adapt(Notifier notifier) { boolean result = false; if (notifier != null) { adapting = true; result = addAdapter(notifier.eAdapters()); adapting = false; } return result; }
@Override protected void unsetTarget(Resource target) { super.unsetTarget(target); clear(target); }
public boolean containsKey(EObject eObject, Object key) { return containsKey(null, eObject, key); }
.<EObject, Resource> createHashMap());
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<Classifier> allParents() { CacheAdapter cache = getCacheAdapter(); if (cache != null) { @SuppressWarnings("unchecked") EList<Classifier> result = (EList<Classifier>) cache.get(this, UMLPackage.Literals.CLASSIFIER___ALL_PARENTS); if (result == null) { cache.put(this, UMLPackage.Literals.CLASSIFIER___ALL_PARENTS, result = ClassifierOperations.allParents(this)); } return result; } return ClassifierOperations.allParents(this); }
@Override protected void addProxy(EObject proxy, EObject context) { if (proxy.eIsProxy()) { if (proxyMap == null) { proxyMap = createHashMap(); } Resource resource = context.eResource(); if (resource != null) { addAdapter(resource); } URI uri = normalizeURI(((InternalEObject) proxy).eProxyURI(), resource); List<EObject> proxies = proxyMap.get(uri); if (proxies == null) { proxyMap.put(uri, proxies = new BasicEList.FastCompare<EObject>()); } proxies.add(proxy); } }
public boolean adapt(Notifier notifier) { boolean result = false; if (notifier != null) { adapting = true; result = addAdapter(notifier.eAdapters()); adapting = false; } return result; }
public Object put(EObject eObject, Object key, Object value) { return put(null, eObject, key, value); }
public Object get(EObject eObject, Object key) { return get(null, eObject, key); }