org.eclipse.emf.cdo.spi.common.revision
Class DelegatingCDORevision

java.lang.Object
  extended by org.eclipse.emf.cdo.spi.common.revision.DelegatingCDORevision
All Implemented Interfaces:
CDOBranchPoint, CDOBranchVersion, CDOIDAndVersion, CDORevisable, CDORevision, CDORevisionData, CDORevisionKey, CDOReferenceAdjustable, InternalCDORevision

public abstract class DelegatingCDORevision
extends Object
implements InternalCDORevision

Since:
3.0

Field Summary
 
Fields inherited from interface org.eclipse.emf.cdo.common.revision.CDORevision
DEPTH_INFINITE, DEPTH_NONE, FIRST_VERSION, MAIN_BRANCH_ID, PERMISSION_PROVIDER, UNCHUNKED
 
Fields inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchPoint
INVALID_DATE, UNSPECIFIED_DATE
 
Fields inherited from interface org.eclipse.emf.cdo.common.branch.CDOBranchVersion
UNSPECIFIED_VERSION
 
Fields inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionData
NIL
 
Constructor Summary
DelegatingCDORevision()
           
 
Method Summary
 void add(EStructuralFeature feature, int index, Object value)
           
 void adjustForCommit(CDOBranch branch, long timeStamp)
           
 boolean adjustReferences(CDOReferenceAdjuster referenceAdjuster)
           
 void clear(EStructuralFeature feature)
           
 InternalCDORevisionDelta compare(CDORevision origin)
           
 boolean contains(EStructuralFeature feature, Object value)
           
 void convertEObjects(CDOIDProvider oidProvider)
           
 InternalCDORevision copy()
           
 CDORevisionData data()
           
 void freeze()
           
 Object get(EStructuralFeature feature, int index)
           
 CDOBranch getBranch()
          Returns the branch of this branch version.
 CDOClassInfo getClassInfo()
           
 Object getContainerID()
           
 int getContainingFeatureID()
          Provides the input to the calculation of the feature in the container revision that actually holds this revision.
abstract  InternalCDORevision getDelegate()
           
 EClass getEClass()
           
 CDOID getID()
           
 CDOList getList(EStructuralFeature feature)
           
 CDOList getList(EStructuralFeature feature, int size)
           
 CDOPermission getPermission()
           
 CDOID getResourceID()
           
 long getRevised()
           
 long getTimeStamp()
          Returns the time stamp of this branch point, or the fixed special time stamp unspecified if this branch point marks the head of a branch.
 Object getValue(EStructuralFeature feature)
          Should never return CDORevisionData.NIL
 int getVersion()
          Returns the version number of this branch version.
 int hashCode(EStructuralFeature feature)
           
 int indexOf(EStructuralFeature feature, Object value)
           
 boolean isEmpty(EStructuralFeature feature)
           
 boolean isHistorical()
          Returns true exactly if CDOBranchPoint.getTimeStamp() does not return CDOBranchPoint.UNSPECIFIED_DATE, false otherwise.
 boolean isReadable()
           
 boolean isResource()
           
 boolean isResourceFolder()
           
 boolean isResourceNode()
           
 boolean isUnchunked()
           
 boolean isValid(CDOBranchPoint branchPoint)
           
 boolean isValid(long timeStamp)
           
 boolean isWritable()
           
 int lastIndexOf(EStructuralFeature feature, Object value)
           
 void merge(CDORevisionDelta delta)
           
 Object move(EStructuralFeature feature, int targetIndex, int sourceIndex)
           
 void read(CDODataInput in)
           
 Object remove(EStructuralFeature feature, int index)
           
 CDORevision revision()
           
 Object set(EStructuralFeature feature, int index, Object value)
           
 void setBranchPoint(CDOBranchPoint branchPoint)
           
 void setContainerID(Object containerID)
           
 void setContainingFeatureID(int containingFeatureID)
           
 void setID(CDOID id)
           
 void setList(EStructuralFeature feature, InternalCDOList list)
           
 void setPermission(CDOPermission permission)
           
 void setResourceID(CDOID resourceID)
           
 void setRevised(long revised)
           
 void setUnchunked()
           
 Object setValue(EStructuralFeature feature, Object value)
           
 void setVersion(int version)
           
 int size(EStructuralFeature feature)
           
 Object[] toArray(EStructuralFeature feature)
           
<T> T[]
toArray(EStructuralFeature feature, T[] array)
           
 void unset(EStructuralFeature feature)
           
 void write(CDODataOutput out, int referenceChunk)
           
 void write(CDODataOutput out, int referenceChunk, CDOBranchPoint securityContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegatingCDORevision

public DelegatingCDORevision()
Method Detail

getDelegate

public abstract InternalCDORevision getDelegate()

adjustReferences

public boolean adjustReferences(CDOReferenceAdjuster referenceAdjuster)
Specified by:
adjustReferences in interface CDOReferenceAdjustable
Since:
4.0

getTimeStamp

public long getTimeStamp()
Description copied from interface: CDOBranchPoint
Returns the time stamp of this branch point, or the fixed special time stamp unspecified if this branch point marks the head of a branch.

Specified by:
getTimeStamp in interface CDOBranchPoint

getBranch

public CDOBranch getBranch()
Description copied from interface: CDOBranchVersion
Returns the branch of this branch version.

Specified by:
getBranch in interface CDOBranchPoint
Specified by:
getBranch in interface CDOBranchVersion

isHistorical

public boolean isHistorical()
Description copied from interface: CDORevision
Returns true exactly if CDOBranchPoint.getTimeStamp() does not return CDOBranchPoint.UNSPECIFIED_DATE, false otherwise.

Specified by:
isHistorical in interface CDORevision

getID

public CDOID getID()
Specified by:
getID in interface CDOIDAndVersion

revision

public CDORevision revision()
Specified by:
revision in interface CDORevisionData

getResourceID

public CDOID getResourceID()
Specified by:
getResourceID in interface CDORevisionData

getContainerID

public Object getContainerID()
Specified by:
getContainerID in interface CDORevisionData

getContainingFeatureID

public int getContainingFeatureID()
Description copied from interface: CDORevisionData
Provides the input to the calculation of the feature in the container revision that actually holds this revision.

Usage Example:

 CDORevision revision = ...;
 CDORevision container = Util.getRevision(revision.data().getContainerID());
 
 int containingFeatureID = revision.data().getContainingFeatureID();
 
 EStructuralFeature feature = containingFeatureID <= InternalEObject.EOPPOSITE_FEATURE_BASE ?
     container.getEClass().getEStructuralFeature(InternalEObject.EOPPOSITE_FEATURE_BASE - containingFeatureID) :
     ((EReference)revision.getEClass().getEStructuralFeature(containingFeatureID)).getEOpposite();

Specified by:
getContainingFeatureID in interface CDORevisionData
See Also:
BasicEObjectImpl.eContainingFeature(), CDORevisionData.getContainerID()

get

public Object get(EStructuralFeature feature,
                  int index)
Specified by:
get in interface CDORevisionData

getEClass

public EClass getEClass()
Specified by:
getEClass in interface CDORevision

getVersion

public int getVersion()
Description copied from interface: CDOBranchVersion
Returns the version number of this branch version.

Specified by:
getVersion in interface CDOBranchVersion
Specified by:
getVersion in interface CDOIDAndVersion

size

public int size(EStructuralFeature feature)
Specified by:
size in interface CDORevisionData

getRevised

public long getRevised()
Specified by:
getRevised in interface CDORevisable

isEmpty

public boolean isEmpty(EStructuralFeature feature)
Specified by:
isEmpty in interface CDORevisionData

isValid

public boolean isValid(long timeStamp)
Specified by:
isValid in interface CDORevision

isValid

public boolean isValid(CDOBranchPoint branchPoint)
Specified by:
isValid in interface CDORevision
Since:
4.0

copy

public InternalCDORevision copy()
Specified by:
copy in interface CDORevision
Specified by:
copy in interface InternalCDORevision
Since:
4.0

getClassInfo

public CDOClassInfo getClassInfo()
Specified by:
getClassInfo in interface InternalCDORevision

setID

public void setID(CDOID id)
Specified by:
setID in interface InternalCDORevision

contains

public boolean contains(EStructuralFeature feature,
                        Object value)
Specified by:
contains in interface CDORevisionData

isResourceNode

public boolean isResourceNode()
Specified by:
isResourceNode in interface CDORevision

setVersion

public void setVersion(int version)
Specified by:
setVersion in interface InternalCDORevision

isResourceFolder

public boolean isResourceFolder()
Specified by:
isResourceFolder in interface CDORevision

indexOf

public int indexOf(EStructuralFeature feature,
                   Object value)
Specified by:
indexOf in interface CDORevisionData

isResource

public boolean isResource()
Specified by:
isResource in interface CDORevision

setBranchPoint

public void setBranchPoint(CDOBranchPoint branchPoint)
Specified by:
setBranchPoint in interface InternalCDORevision

adjustForCommit

public void adjustForCommit(CDOBranch branch,
                            long timeStamp)
Specified by:
adjustForCommit in interface InternalCDORevision

data

public CDORevisionData data()
Specified by:
data in interface CDORevision

lastIndexOf

public int lastIndexOf(EStructuralFeature feature,
                       Object value)
Specified by:
lastIndexOf in interface CDORevisionData

setRevised

public void setRevised(long revised)
Specified by:
setRevised in interface InternalCDORevision

compare

public InternalCDORevisionDelta compare(CDORevision origin)
Specified by:
compare in interface CDORevision
Specified by:
compare in interface InternalCDORevision

setResourceID

public void setResourceID(CDOID resourceID)
Specified by:
setResourceID in interface InternalCDORevision

merge

public void merge(CDORevisionDelta delta)
Specified by:
merge in interface CDORevision

toArray

public <T> T[] toArray(EStructuralFeature feature,
                       T[] array)
Specified by:
toArray in interface CDORevisionData

setContainerID

public void setContainerID(Object containerID)
Specified by:
setContainerID in interface InternalCDORevision

setContainingFeatureID

public void setContainingFeatureID(int containingFeatureID)
Specified by:
setContainingFeatureID in interface InternalCDORevision

toArray

public Object[] toArray(EStructuralFeature feature)
Specified by:
toArray in interface CDORevisionData

add

public void add(EStructuralFeature feature,
                int index,
                Object value)
Specified by:
add in interface InternalCDORevision

hashCode

public int hashCode(EStructuralFeature feature)
Specified by:
hashCode in interface CDORevisionData

clear

public void clear(EStructuralFeature feature)
Specified by:
clear in interface InternalCDORevision

move

public Object move(EStructuralFeature feature,
                   int targetIndex,
                   int sourceIndex)
Specified by:
move in interface InternalCDORevision

remove

public Object remove(EStructuralFeature feature,
                     int index)
Specified by:
remove in interface InternalCDORevision

set

public Object set(EStructuralFeature feature,
                  int index,
                  Object value)
Specified by:
set in interface InternalCDORevision

unset

public void unset(EStructuralFeature feature)
Specified by:
unset in interface InternalCDORevision

getValue

public Object getValue(EStructuralFeature feature)
Description copied from interface: InternalCDORevision
Should never return CDORevisionData.NIL

Specified by:
getValue in interface InternalCDORevision

setValue

public Object setValue(EStructuralFeature feature,
                       Object value)
Specified by:
setValue in interface InternalCDORevision

setList

public void setList(EStructuralFeature feature,
                    InternalCDOList list)
Specified by:
setList in interface InternalCDORevision

getList

public CDOList getList(EStructuralFeature feature)
Specified by:
getList in interface InternalCDORevision

getList

public CDOList getList(EStructuralFeature feature,
                       int size)
Specified by:
getList in interface InternalCDORevision
size - the initialCapacity of a new list to be created if this revision has no list so far (its size will always be 0), or -1 to skip list creation and return null in this case.

read

public void read(CDODataInput in)
          throws IOException
Specified by:
read in interface InternalCDORevision
Throws:
IOException

write

public void write(CDODataOutput out,
                  int referenceChunk)
           throws IOException
Specified by:
write in interface InternalCDORevision
Throws:
IOException

write

public void write(CDODataOutput out,
                  int referenceChunk,
                  CDOBranchPoint securityContext)
           throws IOException
Specified by:
write in interface InternalCDORevision
Throws:
IOException
Since:
4.1

convertEObjects

public void convertEObjects(CDOIDProvider oidProvider)
Specified by:
convertEObjects in interface InternalCDORevision

getPermission

public CDOPermission getPermission()
Specified by:
getPermission in interface CDORevision
Since:
4.1

setPermission

public void setPermission(CDOPermission permission)
Specified by:
setPermission in interface InternalCDORevision
Since:
4.1

isReadable

public boolean isReadable()
Specified by:
isReadable in interface CDORevision
Since:
4.1

isWritable

public boolean isWritable()
Specified by:
isWritable in interface CDORevision
Since:
4.1

freeze

public void freeze()
Specified by:
freeze in interface InternalCDORevision
Since:
4.0

isUnchunked

public boolean isUnchunked()
Specified by:
isUnchunked in interface InternalCDORevision
Since:
4.1

setUnchunked

public void setUnchunked()
Specified by:
setUnchunked in interface InternalCDORevision
Since:
4.1


Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others.