|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
org.eclipse.emf.ecore.util.EcoreUtil.CrossReferencer
A mapping building traverser of a collection of content trees
;
the map is from target object
to a collection of EStructuralFeature.Setting
.
Since this implementation extends a Map implementation, it can yield itself as the result for most operations.
The traverser considers each EObject in the EObject.eCrossReferences()
of each EObject in the content tree,
and creates a setting for each positive match.
This default implementation creates
a map of all cross references.
Field Summary | |
protected Collection |
emfObjects
The collection of objects being cross referenced. |
Constructor Summary | |
protected |
EcoreUtil.CrossReferencer(Collection emfObjects)
Creates an instance for the given collection of objects. |
protected |
EcoreUtil.CrossReferencer(EObject eObject)
Creates an instance for the given object. |
protected |
EcoreUtil.CrossReferencer(Resource resource)
Creates an instance for the given resource. |
protected |
EcoreUtil.CrossReferencer(ResourceSet resourceSet)
Creates an instance for the given resource set. |
Method Summary | |
protected boolean |
containment(EObject eObject)
Return true if the cross referencer should include references from children of the specified object. |
protected void |
crossReference()
Compute the map of cross references. |
protected boolean |
crossReference(EObject eObject,
EReference eReference,
EObject crossReferencedEObject)
Return true if the specified eReference from eObject to crossReferencedEObject should be considiered a cross reference by this cross referencer. |
protected void |
done()
Reset this cross referencer's object set. |
static Map |
find(Collection emfObjects)
Returns a map of all cross references in the content tree. |
protected Collection |
getCollection(Object key)
Return the collection of cross reference settings
for the specified key (target object). |
protected EContentsEList.FeatureIterator |
getCrossReferences(EObject eObject)
|
protected void |
handleCrossReference(EObject eObject)
|
protected Collection |
newCollection()
Return a collection to use for storing settings . |
protected TreeIterator |
newContentsIterator()
Return a tree iterator over the content trees of this cross referencer's objects. |
static void |
print(PrintStream out,
Collection settings)
Print the specified collection of settings
to the specified stream. |
static void |
print(PrintStream out,
Map crossReferenceMap)
Print the specified cross reference map to the specified stream. |
protected boolean |
resolve()
Return true if cross references that are proxies should be resolved. |
String |
toString()
Returns a string representation of this cross referencer. |
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
Field Detail |
protected Collection emfObjects
Constructor Detail |
protected EcoreUtil.CrossReferencer(EObject eObject)
eObject
- the object to cross reference.protected EcoreUtil.CrossReferencer(Resource resource)
resource
- the resource to cross reference.protected EcoreUtil.CrossReferencer(ResourceSet resourceSet)
resourceSet
- the resource set to cross reference.protected EcoreUtil.CrossReferencer(Collection emfObjects)
emfObjects
- the collection of objects to cross reference.Method Detail |
protected boolean containment(EObject eObject)
eObject
- an object in the cross referencer's content tree.
protected boolean crossReference(EObject eObject, EReference eReference, EObject crossReferencedEObject)
eObject
- an object in the cross referencer's content tree.eReference
- a reference from the object.crossReferencedEObject
- the target of the specified reference.
protected boolean resolve()
protected Collection newCollection()
settings
.
protected Collection getCollection(Object key)
settings
for the specified key (target object).
key
- the key for the cross referencer's map.
protected TreeIterator newContentsIterator()
protected void crossReference()
protected EContentsEList.FeatureIterator getCrossReferences(EObject eObject)
protected void handleCrossReference(EObject eObject)
protected void done()
public static Map find(Collection emfObjects)
emfObjects
- a collection of objects whose combined content trees should be considered.
public String toString()
public static void print(PrintStream out, Map crossReferenceMap)
out
- the stream to print to.crossReferenceMap
- a map (cross referencer) to print.public static void print(PrintStream out, Collection settings)
settings
to the specified stream.
out
- the stream to print to.settings
- a collection of settings.
|
Copyright 2001-2004 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |