org.eclipse.emf.emfstore.internal.server.model.impl.api
Class ESChangePackageImpl

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.common.api.AbstractAPIImpl<ESChangePackage,CP>
      extended by org.eclipse.emf.emfstore.internal.server.model.impl.api.ESAbstractChangePackageImpl<ChangePackage>
          extended by org.eclipse.emf.emfstore.internal.server.model.impl.api.ESChangePackageImpl
All Implemented Interfaces:
InternalAPIDelegator<ESChangePackage,ChangePackage>, ESChangePackage

public class ESChangePackageImpl
extends ESAbstractChangePackageImpl<ChangePackage>
implements ESChangePackage

Mapping between ESChangePackage and ChangePackage.

Author:
emueller

Constructor Summary
ESChangePackageImpl(ChangePackage changePackage)
          Constructor.
 
Method Summary
 void add(ESOperation op)
          Add a single a operation to this change package.
 void addAll(List<ESOperation> ops)
          Adds a list of operations to this change package.
 void clear()
          Clears all operations from this change package.
 ESLogMessage getLogMessage()
          Returns the ESLogMessage that was entered by the user and is supposed to describe the changes within the change package.
 boolean isEmpty()
          Whether this change package contains any operations.
 ESCloseableIterable<ESOperation> operations()
          Returns an ESCloseableIterable that iterates over all operations of this change package.
 List<ESOperation> removeFromEnd(int n)
          Removes the given number of operations from this change package beginning at the end.
 ESChangePackage reverse()
          Returns the operations of this change package in the reversed order.
 void setLogMessage(ESLogMessage logMessage)
          Sets the log message of this change package.
 int size()
          Returns the number of operations this change package contains.
 ChangePackage toInternalAPI()
          Returns the internal interface of this class.
 
Methods inherited from class org.eclipse.emf.emfstore.internal.common.api.AbstractAPIImpl
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ESChangePackageImpl

public ESChangePackageImpl(ChangePackage changePackage)
Constructor.

Parameters:
changePackage - the delegate
Method Detail

getLogMessage

public ESLogMessage getLogMessage()
Returns the ESLogMessage that was entered by the user and is supposed to describe the changes within the change package.

Specified by:
getLogMessage in interface ESChangePackage
Returns:
the log message as entered by the user
See Also:
ESChangePackage.getLogMessage()

setLogMessage

public void setLogMessage(ESLogMessage logMessage)
Sets the log message of this change package.

Specified by:
setLogMessage in interface ESChangePackage
Parameters:
logMessage - the log message to be set
See Also:
ESChangePackage.setLogMessage(org.eclipse.emf.emfstore.server.model.ESLogMessage)

addAll

public void addAll(List<ESOperation> ops)
Adds a list of operations to this change package.

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

add

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

Specified by:
add in interface ESChangePackage
Parameters:
op - the operation to be added
See Also:
ESChangePackage.add(org.eclipse.emf.emfstore.server.model.ESOperation)

clear

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

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

isEmpty

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

Specified by:
isEmpty in interface ESChangePackage
Returns:
true, if this change package contains no operations, false otherwise
See Also:
ESChangePackage.isEmpty()

removeFromEnd

public List<ESOperation> removeFromEnd(int n)
Removes the given number of operations from this change package beginning at the end.

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

operations

public ESCloseableIterable<ESOperation> operations()
Returns an ESCloseableIterable that iterates over all operations of this change package.
You MUST call close on the returned ESCloseableIterable.

Specified by:
operations in interface ESChangePackage
Returns:
an ESCloseableIterable that enables iterating over all operations.
See Also:
ESChangePackage.operations()

size

public int size()
Returns the number of operations this change package contains.

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

reverse

public ESChangePackage reverse()
Returns the operations of this change package in the reversed order. Note that you must call close() on the returned ESCloseableIterable.

Specified by:
reverse in interface ESChangePackage
Returns:
the operations in reversed order
See Also:
ESChangePackage.reverse()

toInternalAPI

public ChangePackage toInternalAPI()
Returns the internal interface of this class.

Specified by:
toInternalAPI in interface InternalAPIDelegator<ESChangePackage,ChangePackage>
Specified by:
toInternalAPI in class ESAbstractChangePackageImpl<ChangePackage>
Returns:
the internal interface of this class
See Also:
ESAbstractChangePackageImpl.toInternalAPI()


Copyright © 2016. All Rights Reserved.