org.eclipse.emf.emfstore.internal.client.model.impl
Class RemovedElementsCache

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.model.impl.RemovedElementsCache

public class RemovedElementsCache
extends Object

Caches removed elements.

Author:
emueller

Constructor Summary
RemovedElementsCache(IdEObjectCollectionImpl collection)
          Constructor.
 
Method Summary
 void addRemovedElement(org.eclipse.emf.ecore.EObject rootElement, Set<org.eclipse.emf.ecore.EObject> allModelElements, List<SettingWithReferencedElement> crossReferences)
          Adds a new deleted element to the cache.
 void clear()
          Clears the cache.
 boolean contains(org.eclipse.emf.ecore.EObject modelElement)
          Checks whether the given model element has been previously removed.
 ModelElementId getRemovedElementId(org.eclipse.emf.ecore.EObject removedElement)
          Returns the id of the specified removed element.
 List<org.eclipse.emf.ecore.EObject> getRemovedRootElements()
          Returns a list of all removed root elements.
 List<SettingWithReferencedElement> getRemovedRootElementToReferenceSetting(org.eclipse.emf.ecore.EObject modelElement)
          Returns the saved settings of the specified model element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemovedElementsCache

public RemovedElementsCache(IdEObjectCollectionImpl collection)
Constructor.

Parameters:
collection - an underlying IdEObjectCollection
Method Detail

addRemovedElement

public void addRemovedElement(org.eclipse.emf.ecore.EObject rootElement,
                              Set<org.eclipse.emf.ecore.EObject> allModelElements,
                              List<SettingWithReferencedElement> crossReferences)
Adds a new deleted element to the cache.

Parameters:
rootElement - the deleted element
allModelElements - the deleted element and its contained elements
crossReferences - in- and outgoing references of all model elements

getRemovedRootElements

public List<org.eclipse.emf.ecore.EObject> getRemovedRootElements()
Returns a list of all removed root elements. Children of any root element are not included in the returned list.

Returns:
list of all root elements

contains

public boolean contains(org.eclipse.emf.ecore.EObject modelElement)
Checks whether the given model element has been previously removed.

Parameters:
modelElement - the model element that should be checked whether it has been removed
Returns:
true, if the model element has been removed, false otherwise

getRemovedElementId

public ModelElementId getRemovedElementId(org.eclipse.emf.ecore.EObject removedElement)
Returns the id of the specified removed element.

Parameters:
removedElement - The removed element whose id is requested
Returns:
the model element id of the removed element

getRemovedRootElementToReferenceSetting

public List<SettingWithReferencedElement> getRemovedRootElementToReferenceSetting(org.eclipse.emf.ecore.EObject modelElement)
Returns the saved settings of the specified model element.

Parameters:
modelElement - The model element whose settings are requested
Returns:
the settings

clear

public void clear()
Clears the cache.



Copyright © 2015. All Rights Reserved.