org.eclipse.emf.emfstore.internal.server.model.versioning.impl
Class ChangePackageImpl

java.lang.Object
  extended by org.eclipse.emf.common.notify.impl.BasicNotifierImpl
      extended by org.eclipse.emf.ecore.impl.BasicEObjectImpl
          extended by org.eclipse.emf.ecore.impl.EObjectImpl
              extended by org.eclipse.emf.emfstore.internal.server.model.versioning.impl.ChangePackageImpl
All Implemented Interfaces:
org.eclipse.emf.common.notify.Notifier, org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.InternalEObject, APIDelegate<ESChangePackage>, AbstractChangePackage, ChangePackage

public class ChangePackageImpl
extends org.eclipse.emf.ecore.impl.EObjectImpl
implements ChangePackage

An implementation of the model object ' Change Package'.

The following features are implemented:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E extends Object & org.eclipse.emf.common.notify.Adapter>, org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList
 
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.InternalEObject
org.eclipse.emf.ecore.InternalEObject.EStore
 
Field Summary
 
Fields inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
ELAST_EOBJECT_FLAG
 
Fields inherited from interface org.eclipse.emf.ecore.InternalEObject
EOPPOSITE_FEATURE_BASE
 
Method Summary
 void add(AbstractOperation operation)
          Add a single operation to this change package.
 void addAll(List<AbstractOperation> operations)
          Adds all given operations to this change package.
 void apply(Project project)
          Apply all operations in the change package to the given project.
 void apply(Project project, boolean force)
          Apply all operations in the change package to the given project.
 void attachToProjectSpace(ChangePackageContainer changePackageHolder)
          Attaches this change package to the given value.
 LogMessage basicGetLogMessage()
           
 org.eclipse.emf.common.notify.NotificationChain basicSetLogMessage(LogMessage newLogMessage, org.eclipse.emf.common.notify.NotificationChain msgs)
           
 void cannonize()
          Cannonize the change package, that is remove all operations that are masked by later operations.
 void clear()
          Clears all operations from this change package.
 ESChangePackageImpl createAPI()
          Creates the API interface for this class.
 Object eGet(int featureID, boolean resolve, boolean coreType)
           
 org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd, int featureID, org.eclipse.emf.common.notify.NotificationChain msgs)
           
 boolean eIsSet(int featureID)
           
 void eSet(int featureID, Object newValue)
           
 void eUnset(int featureID)
           
 AbstractOperation get(int index)
          Returns the operation at the given index.
 Set<ModelElementId> getAllInvolvedModelElements()
          Returns all model elements that are involved in this change package.
 List<AbstractOperation> getCopyOfOperations()
          Retrieve a copy of all operations in the change package.
 org.eclipse.emf.common.util.EList<Event> getEvents()
           
 List<AbstractOperation> getLeafOperations()
          Get all leaf operations of a change package, decomposing all composite operations.
 LogMessage getLogMessage()
           
 org.eclipse.emf.common.util.EList<AbstractOperation> getOperations()
          Returns the operations of the change package.
 int getSize()
          Counts the number of Leaf Operations within this change package.
 List<AbstractOperation> getTouchingOperations(ModelElementId modelElementId)
          Get all operations of a change package, that are touching the given model element id
 org.eclipse.emf.common.util.EList<VersionProperty> getVersionProperties()
           
 boolean isEmpty()
          Whether this change package has any operations.
 int leafSize()
          Returns the number of leaf operations that are contained within this change package.
 ESCloseableIterable<AbstractOperation> operations()
          Returns a handle for iterating through operations contained in this change package.
NOTE: Callers must call close on the returned handle.
 List<AbstractOperation> removeAtEnd(int n)
          Removes the given number of operations starting from the end.
 ChangePackage reverse()
          Reverse the change package.
 ESCloseableIterable<AbstractOperation> reversedOperations()
          Returns a handle for iterating through operations contained in this change package backwards.
NOTE: Callers must call close on the returned handle.
 void save()
          Save this change package.
 void setLogMessage(LogMessage newLogMessage)
           
 int size()
          Returns the size of this change package, that is, how many operations are contained in it.
 ESChangePackageImpl toAPI()
          Returns the API representation of this change package.
 
Methods inherited from class org.eclipse.emf.ecore.impl.EObjectImpl
eAdapters, eClass, eContainerFeatureID, eDeliver, eInternalContainer, eInvoke, eIsProxy, eSetClass, eSetDeliver, eSetProxyURI
 
Methods inherited from class org.eclipse.emf.ecore.impl.BasicEObjectImpl
eAllContents, eBaseStructuralFeatureID, eBasicRemoveFromContainer, eBasicRemoveFromContainerFeature, eBasicSetContainer, eContainer, eContainingFeature, eContainmentFeature, eContains, eContents, eCrossReferences, eDerivedOperationID, eDerivedOperationID, eDerivedStructuralFeatureID, eDerivedStructuralFeatureID, eDirectResource, eDynamicBasicRemoveFromContainer, eDynamicGet, eDynamicGet, eDynamicInverseAdd, eDynamicInverseRemove, eDynamicInvoke, eDynamicIsSet, eDynamicIsSet, eDynamicSet, eDynamicSet, eDynamicUnset, eDynamicUnset, eGet, eGet, eGet, eInternalResource, eInverseAdd, eInverseAdd, eInverseRemove, eInvoke, eIsSet, eObjectForURIFragmentSegment, eOpenGet, eOpenIsSet, eOpenSet, eOpenUnset, eProxyURI, eResolveProxy, eResource, eSet, eSetResource, eSetStore, eSetting, eStore, eUnset, eURIFragmentSegment, eVirtualGet, eVirtualGet, eVirtualIsSet, eVirtualSet, eVirtualUnset, toString
 
Methods inherited from class org.eclipse.emf.common.notify.impl.BasicNotifierImpl
eNotificationRequired, eNotify
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
 
Methods inherited from interface org.eclipse.emf.common.notify.Notifier
eAdapters, eDeliver, eNotify, eSetDeliver
 
Methods inherited from interface org.eclipse.emf.ecore.InternalEObject
eNotificationRequired
 

Method Detail

getOperations

public org.eclipse.emf.common.util.EList<AbstractOperation> getOperations()
Returns the operations of the change package. Will not enforce uniqueness, do NOT add the same element twice!

Specified by:
getOperations in interface ChangePackage
Returns:
a list of operations.
See Also:
VersioningPackage.getChangePackage_Operations()

getEvents

public org.eclipse.emf.common.util.EList<Event> getEvents()

Specified by:
getEvents in interface ChangePackage
Returns:
the value of the 'Events' containment reference list.
See Also:
VersioningPackage.getChangePackage_Events()

getLogMessage

public LogMessage getLogMessage()

Specified by:
getLogMessage in interface AbstractChangePackage
Returns:
the value of the 'Log Message' containment reference.
See Also:
AbstractChangePackage.setLogMessage(LogMessage), VersioningPackage.getAbstractChangePackage_LogMessage()

basicGetLogMessage

public LogMessage basicGetLogMessage()


basicSetLogMessage

public org.eclipse.emf.common.notify.NotificationChain basicSetLogMessage(LogMessage newLogMessage,
                                                                          org.eclipse.emf.common.notify.NotificationChain msgs)


setLogMessage

public void setLogMessage(LogMessage newLogMessage)

Specified by:
setLogMessage in interface AbstractChangePackage
Parameters:
newLogMessage - the new value of the 'Log Message' containment reference.
See Also:
AbstractChangePackage.getLogMessage()

getVersionProperties

public org.eclipse.emf.common.util.EList<VersionProperty> getVersionProperties()

Specified by:
getVersionProperties in interface ChangePackage
Returns:
the value of the 'Version Properties' containment reference list.
See Also:
VersioningPackage.getChangePackage_VersionProperties()

reverse

public ChangePackage reverse()
Reverse the change package. That applying the change package and the reversed change package to a project is a nop.

Specified by:
reverse in interface AbstractChangePackage
Specified by:
reverse in interface ChangePackage
Returns:
the reversed change package

apply

public void apply(Project project)
Apply all operations in the change package to the given project.

Specified by:
apply in interface AbstractChangePackage
Specified by:
apply in interface ChangePackage
Parameters:
project - the project
See Also:
ChangePackage.apply(org.eclipse.emf.emfstore.internal.common.model.Project)

apply

public void apply(Project project,
                  boolean force)
Apply all operations in the change package to the given project. Additional you can force the operations to be applied with illegal operations being ignored.

Specified by:
apply in interface AbstractChangePackage
Specified by:
apply in interface ChangePackage
Parameters:
project - the project
force - if true, illegal Operations won't stop the other to be applied
See Also:
ChangePackage.apply(org.eclipse.emf.emfstore.internal.common.model.Project, boolean)

cannonize

public void cannonize()
Cannonize the change package, that is remove all operations that are masked by later operations.

Specified by:
cannonize in interface ChangePackage

eInverseRemove

public org.eclipse.emf.common.notify.NotificationChain eInverseRemove(org.eclipse.emf.ecore.InternalEObject otherEnd,
                                                                      int featureID,
                                                                      org.eclipse.emf.common.notify.NotificationChain msgs)

Overrides:
eInverseRemove in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

eGet

public Object eGet(int featureID,
                   boolean resolve,
                   boolean coreType)

Specified by:
eGet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eGet in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

eSet

public void eSet(int featureID,
                 Object newValue)

Specified by:
eSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eSet in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

eUnset

public void eUnset(int featureID)

Specified by:
eUnset in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eUnset in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

eIsSet

public boolean eIsSet(int featureID)

Specified by:
eIsSet in interface org.eclipse.emf.ecore.InternalEObject
Overrides:
eIsSet in class org.eclipse.emf.ecore.impl.BasicEObjectImpl

getCopyOfOperations

public List<AbstractOperation> getCopyOfOperations()
Retrieve a copy of all operations in the change package.

Specified by:
getCopyOfOperations in interface ChangePackage
See Also:
ChangePackage.getCopyOfOperations()

getLeafOperations

public List<AbstractOperation> getLeafOperations()
Get all leaf operations of a change package, decomposing all composite operations. The effect of the leaf operations on a project is the same as the effect of the root operations of this change package.

Specified by:
getLeafOperations in interface ChangePackage
Returns:
a list of leaf operations.

getAllInvolvedModelElements

public Set<ModelElementId> getAllInvolvedModelElements()
Returns all model elements that are involved in this change package.

Specified by:
getAllInvolvedModelElements in interface ChangePackage
Returns:
a set of model element ids
See Also:
ChangePackage.getAllInvolvedModelElements()

getTouchingOperations

public List<AbstractOperation> getTouchingOperations(ModelElementId modelElementId)
Description copied from interface: ChangePackage
Get all operations of a change package, that are touching the given model element id

Specified by:
getTouchingOperations in interface ChangePackage
Returns:
a list of leaf operations.

getSize

public int getSize()
Description copied from interface: ChangePackage
Counts the number of Leaf Operations within this change package. The method will recursivly go thru all composite operations

Specified by:
getSize in interface ChangePackage
Returns:
the number of Leaf Operations

toAPI

public ESChangePackageImpl toAPI()
Returns the API representation of this change package.

Specified by:
toAPI in interface APIDelegate<ESChangePackage>
Specified by:
toAPI in interface AbstractChangePackage
Returns:
the API representation of this change package.
See Also:
APIDelegate.toAPI()

createAPI

public ESChangePackageImpl createAPI()
Creates the API interface for this class.

Specified by:
createAPI in interface APIDelegate<ESChangePackage>
Returns:
the API interface of this class
See Also:
APIDelegate.createAPI()

add

public void add(AbstractOperation operation)
Add a single operation to this change package.

Specified by:
add in interface AbstractChangePackage
Parameters:
operation - the operation to be added
See Also:
AbstractChangePackage.add(org.eclipse.emf.emfstore.internal.server.model.versioning.operations.AbstractOperation)

addAll

public void addAll(List<AbstractOperation> operations)
Adds all given operations to this change package.

Specified by:
addAll in interface AbstractChangePackage
Parameters:
operations - the operations to be added
See Also:
AbstractChangePackage.addAll(java.util.List)

size

public int size()
Returns the size of this change package, that is, how many operations are contained in it.

Specified by:
size in interface AbstractChangePackage
Returns:
the number of operations contained in this change package
See Also:
AbstractChangePackage.size()

operations

public ESCloseableIterable<AbstractOperation> operations()
Returns a handle for iterating through operations contained in this change package.
NOTE: Callers must call close on the returned handle.

Specified by:
operations in interface AbstractChangePackage
Returns:
a handle that enables iterating through all operations of this change package
See Also:
AbstractChangePackage.operations()

reversedOperations

public ESCloseableIterable<AbstractOperation> reversedOperations()
Returns a handle for iterating through operations contained in this change package backwards.
NOTE: Callers must call close on the returned handle.

Specified by:
reversedOperations in interface AbstractChangePackage
Returns:
a handle that enables iterating through all operations of this change package
See Also:
AbstractChangePackage.reversedOperations()

isEmpty

public boolean isEmpty()
Whether this change package has any operations.

Specified by:
isEmpty in interface AbstractChangePackage
Returns:
true, if this change package is empty, false otherwise
See Also:
AbstractChangePackage.isEmpty()

removeAtEnd

public List<AbstractOperation> removeAtEnd(int n)
Removes the given number of operations starting from the end.

Specified by:
removeAtEnd in interface AbstractChangePackage
Parameters:
n - the number of operations to be removed
Returns:
the removed operations
See Also:
AbstractChangePackage.removeAtEnd(int)

clear

public void clear()
Clears all operations from this change package.

Specified by:
clear in interface AbstractChangePackage
See Also:
AbstractChangePackage.clear()

attachToProjectSpace

public void attachToProjectSpace(ChangePackageContainer changePackageHolder)
Attaches this change package to the given value.

Specified by:
attachToProjectSpace in interface AbstractChangePackage
Parameters:
changePackageHolder - the value to which this change package will be attached to
See Also:
AbstractChangePackage.attachToProjectSpace(org.eclipse.emf.emfstore.internal.server.model.versioning.impl.persistent.ChangePackageContainer)

leafSize

public int leafSize()
Returns the number of leaf operations that are contained within this change package.

Specified by:
leafSize in interface AbstractChangePackage
Returns:
the number of leaf operations contained in this change package
See Also:
AbstractChangePackage.leafSize()

save

public void save()
          throws IOException
Save this change package.

Specified by:
save in interface AbstractChangePackage
Throws:
IOException
See Also:
AbstractChangePackage.save()

get

public AbstractOperation get(int index)
Returns the operation at the given index.

Specified by:
get in interface AbstractChangePackage
Parameters:
index - the requested index
Returns:
the operation corresponding to the given index
See Also:
AbstractChangePackage.get(int)


Copyright © 2016. All Rights Reserved.