public class AllInstancesContentAdapter
extends org.eclipse.emf.ecore.util.EContentAdapter
EObject
s in the scope observed (typically
a ResourceSet
), keyed by the EClass
es to which the objects conform. This allows
for fast lookup, e.g., of an allInstances()
expression value in the given scope.Constructor and Description |
---|
AllInstancesContentAdapter() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<org.eclipse.emf.ecore.EObject> |
allInstances(org.eclipse.emf.ecore.EClass c) |
static AllInstancesContentAdapter |
getInstanceForRootContextOf(org.eclipse.emf.common.notify.Notifier context)
Looks up an adapter of type
AllInstancesContentAdapter in the adapter list of
context 's root context. |
protected void |
setTarget(org.eclipse.emf.ecore.EObject target) |
protected void |
unsetTarget(org.eclipse.emf.ecore.EObject target) |
addAdapter, basicSetTarget, basicUnsetTarget, handleContainment, notifyChanged, removeAdapter, resolve, selfAdapt, setTarget, setTarget, setTarget, unsetTarget, unsetTarget, unsetTarget, unsetTarget
public static AllInstancesContentAdapter getInstanceForRootContextOf(org.eclipse.emf.common.notify.Notifier context)
AllInstancesContentAdapter
in the adapter list of
context
's root context. The root context is determined by ascending the EObject
containment hierarchy, then to a Resource
and perhaps a ResourceSet
. The last element
reachable in this order is the root context. If on this root context an adapter of type
AllInstancesContentAdapter
is already registered, it is returned. Otherwise, a new
adapter of this class is created and added to the root context's adapter list. This will recursively
apply the adapter to all contents, populating the adapter's allInstances
map so that
afterwards allInstances(EClass)
returns results in the scope of context
's
root context.protected void setTarget(org.eclipse.emf.ecore.EObject target)
setTarget
in class org.eclipse.emf.ecore.util.EContentAdapter
protected void unsetTarget(org.eclipse.emf.ecore.EObject target)
unsetTarget
in class org.eclipse.emf.ecore.util.EContentAdapter
public java.util.Set<org.eclipse.emf.ecore.EObject> allInstances(org.eclipse.emf.ecore.EClass c)