public class MMIResourceCache
extends java.lang.Object
Clients can cache newly created target elements, Recache existing
target elements with a new StructuredReferenceKey
, Get
cached target elements for a given StructuredReferenceKey
Constructor and Description |
---|
MMIResourceCache() |
Modifier and Type | Method and Description |
---|---|
static void |
cache(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
org.eclipse.emf.ecore.EObject element)
Caches the specified target element using its StructuredReference
as a key.
|
static void |
dump(org.eclipse.emf.transaction.TransactionalEditingDomain domain)
Dumps the cache.
|
static org.eclipse.emf.ecore.EObject |
getCachedElement(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
StructuredReferenceKey key)
Retrieves the cached element for a given
key . |
static int |
getSize(org.eclipse.emf.transaction.TransactionalEditingDomain domain)
Returns the size of the resource cache.
|
static void |
recache(org.eclipse.emf.transaction.TransactionalEditingDomain domain,
StructuredReferenceKey oldKey,
StructuredReferenceKey newKey)
Recaches a cached element for a given
oldKey with a
newKey . |
public static org.eclipse.emf.ecore.EObject getCachedElement(org.eclipse.emf.transaction.TransactionalEditingDomain domain, StructuredReferenceKey key)
key
. The
key
is based on StructuredReference
used to
activate the target object.domain
- TransactionalEditingDomain that contains the ResourceSet of
the EObject's Resourcekey
- StructuredReferenceKey
to locate the
target element in the cache.null
.public static void cache(org.eclipse.emf.transaction.TransactionalEditingDomain domain, org.eclipse.emf.ecore.EObject element)
domain
- TransactionalEditingDomain containing the MMI resource in
which the EObject element will be cachedelement
- ITarget to be cached. The element passed should implement
ITarget
.public static void recache(org.eclipse.emf.transaction.TransactionalEditingDomain domain, StructuredReferenceKey oldKey, StructuredReferenceKey newKey)
oldKey
with a
newKey
.domain
- TransactionalEditingDomain containing the MMI resource in
which the EObject element will be recachedoldKey
- Old Key for the mapped elementnewKey
- New Key for the mapped elementpublic static int getSize(org.eclipse.emf.transaction.TransactionalEditingDomain domain)
This is for testing only!
domain
- TransactionalEditingDomain of the cachepublic static void dump(org.eclipse.emf.transaction.TransactionalEditingDomain domain)
This is for testing only!
domain
- TransactionalEditingDomain of the cache