Package org.eclipse.emf.cdo.spi.common.revision

## Class DelegatingCDORevision

- java.lang.Object
- - org.eclipse.emf.cdo.spi.common.revision.DelegatingCDORevision

- All Implemented Interfaces:
    `CDOBranchPoint`, `CDOBranchProvider`, `CDOBranchVersion`, `CDOIdentifiable`, `CDOIDAndVersion`, `CDORevisable`, `CDORevision`, `CDORevisionData`, `CDORevisionKey`, `CDOTimeProvider`, `CDOVersionProvider`, `CDOBranchAdjustable`, `CDOReferenceAdjustable`, `InternalCDORevision`

      public abstract class DelegatingCDORevision
      extends java.lang.Object
      implements InternalCDORevision

  If the meaning of this type isn't clear, there really should be more of a description here...
  Since:
    3.0
  Author:
    Eike Stepper

- - ### Field Summary

    - ### 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.CDORevision

      `DEPTH_INFINITE, DEPTH_NONE, FIRST_VERSION, MAIN_BRANCH_ID, PERMISSION_PROVIDER, UNCHUNKED`

    - ### Fields inherited from interface org.eclipse.emf.cdo.common.revision.CDORevisionData

      `NIL`

    - ### Fields inherited from interface org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision

      `DO_NOT_CREATE_LIST`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DelegatingCDORevision()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `accept​(CDORevisionValueVisitor visitor)` |
    `void` | `accept​(CDORevisionValueVisitor visitor, java.util.function.Predicate<EStructuralFeature> filter)` |
    `void` | `accept​(CDORevisionValueVisitor visitor, org.eclipse.net4j.util.Predicate<EStructuralFeature> filter)` | Deprecated.
    `void` | `add​(EStructuralFeature feature, int index, java.lang.Object value)` |
    `void` | `adjustBranches​(CDOBranchManager newBranchManager)` |
    `void` | `adjustForCommit​(CDOBranch branch, long timeStamp)` |
    `boolean` | `adjustReferences​(CDOReferenceAdjuster referenceAdjuster)` |
    `boolean` | `bypassPermissionChecks​(boolean on)` | Enables or disables permission checking for this revision.
    `void` | `clear​(EStructuralFeature feature)` |
    `EStructuralFeature[]` | `clearValues()` |
    `InternalCDORevisionDelta` | `compare​(CDORevision origin)` |
    `boolean` | `contains​(EStructuralFeature feature, java.lang.Object value)` |
    `void` | `convertEObjects​(CDOIDProvider oidProvider)` |
    `InternalCDORevision` | `copy()` |
    `CDORevisionData` | `data()` |
    `void` | `freeze()` |
    `java.lang.Object` | `get​(EStructuralFeature feature, int index)` |
    `InternalCDOBranch` | `getBranch()` | Returns the branch of this branch version.
    `InternalCDOClassInfo` | `getClassInfo()` |
    `java.lang.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)` | Deprecated.
    `CDOList` | `getList​(EStructuralFeature feature, int initialCapacity)` | Deprecated.
    `CDOList` | `getListOrNull​(EStructuralFeature feature)` |
    `CDOList` | `getOrCreateList​(EStructuralFeature feature)` | Same as `getOrCreateList(feature, 0)`.
    `CDOList` | `getOrCreateList​(EStructuralFeature feature, int size)` | Returns the list that represents the passed feature, possibly creates it if needed.
    `CDOPermission` | `getPermission()` |
    `InternalCDORevision` | `getProperRevision()` |
    `CDOID` | `getResourceID()` |
    `java.lang.String` | `getResourceNodeName()` |
    `long` | `getRevised()` |
    `InternalCDORevision` | `getRevisionForID​(CDOID id)` |
    `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.
    `java.lang.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, java.lang.Object value)` |
    `boolean` | `isEmpty​(EStructuralFeature feature)` |
    `boolean` | `isFrozen()` |
    `boolean` | `isHistorical()` | Returns `true` exactly if `CDOBranchPoint.getTimeStamp()` does not return `CDOBranchPoint.UNSPECIFIED_DATE`, `false` otherwise.
    `boolean` | `isListPreserving()` |
    `boolean` | `isReadable()` |
    `boolean` | `isResource()` |
    `boolean` | `isResourceFolder()` |
    `boolean` | `isResourceNode()` |
    `boolean` | `isUnchunked()` |
    `boolean` | `isValid​(long timeStamp)` |
    `boolean` | `isValid​(CDOBranchPoint branchPoint)` |
    `boolean` | `isWritable()` |
    `int` | `lastIndexOf​(EStructuralFeature feature, java.lang.Object value)` |
    `void` | `merge​(CDORevisionDelta delta)` |
    `java.lang.Object` | `move​(EStructuralFeature feature, int targetIndex, int sourceIndex)` |
    `void` | `read​(CDODataInput in)` |
    `boolean` | `readValues​(CDODataInput in)` |
    `java.lang.Object` | `remove​(EStructuralFeature feature, int index)` |
    `CDORevision` | `revision()` |
    `java.lang.Object` | `set​(EStructuralFeature feature, int index, java.lang.Object value)` |
    `void` | `setBranchPoint​(CDOBranchPoint branchPoint)` |
    `void` | `setContainerID​(java.lang.Object containerID)` |
    `void` | `setContainingFeatureID​(int containingFeatureID)` |
    `void` | `setID​(CDOID id)` |
    `void` | `setList​(EStructuralFeature feature, InternalCDOList list)` |
    `void` | `setListPreserving()` | The default behavior of a revision for calls to the `InternalCDORevision.clear(EStructuralFeature)` and `InternalCDORevision.unset(EStructuralFeature)` methods is to set the feature's value to null (discarding the value itself, a List).
    `void` | `setPermission​(CDOPermission permission)` |
    `void` | `setResourceID​(CDOID resourceID)` |
    `void` | `setRevised​(long revised)` |
    `void` | `setUnchunked()` |
    `java.lang.Object` | `setValue​(EStructuralFeature feature, java.lang.Object value)` |
    `void` | `setVersion​(int version)` |
    `int` | `size​(EStructuralFeature feature)` |
    `java.lang.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)` |
    `void` | `writeValues​(CDODataOutput out, int referenceChunk)` |

    - ### 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()

    - #### getRevisionForID

          public InternalCDORevision getRevisionForID​(CDOID id)

      Specified by:
        `getRevisionForID` in interface `InternalCDORevision`
      Since:
        4.2

    - #### getProperRevision

          public InternalCDORevision getProperRevision()

      Specified by:
        `getProperRevision` in interface `InternalCDORevision`
      Since:
        4.2

    - #### adjustReferences

          public boolean adjustReferences​(CDOReferenceAdjuster referenceAdjuster)

      Specified by:
        `adjustReferences` in interface `CDOReferenceAdjustable`
      Since:
        4.0

    - #### adjustBranches

          public void adjustBranches​(CDOBranchManager newBranchManager)

      Specified by:
        `adjustBranches` in interface `CDOBranchAdjustable`
      Since:
        4.3

    - #### 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`
      Specified by:
        `getTimeStamp` in interface `CDOTimeProvider`

    - #### getBranch

          public InternalCDOBranch getBranch()

      Description copied from interface: `CDOBranchVersion`
      Returns the branch of this branch version.
      Specified by:
        `getBranch` in interface `CDOBranchPoint`
      Specified by:
        `getBranch` in interface `CDOBranchProvider`
      Specified by:
        `getBranch` in interface `CDOBranchVersion`
      Specified by:
        `getBranch` in interface `InternalCDORevision`
      Since:
        4.2

    - #### 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 `CDOIdentifiable`

    - #### revision

          public CDORevision revision()

      Specified by:
        `revision` in interface `CDORevisionData`

    - #### getResourceID

          public CDOID getResourceID()

      Specified by:
        `getResourceID` in interface `CDORevisionData`

    - #### getContainerID

          public java.lang.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 java.lang.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`
      Specified by:
        `getVersion` in interface `CDOVersionProvider`

    - #### 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 InternalCDOClassInfo getClassInfo()

      Specified by:
        `getClassInfo` in interface `CDORevision`
      Specified by:
        `getClassInfo` in interface `InternalCDORevision`
      Since:
        4.2

    - #### setID

          public void setID​(CDOID id)

      Specified by:
        `setID` in interface `InternalCDORevision`

    - #### contains

          public boolean contains​(EStructuralFeature feature,
                                  java.lang.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,
                             java.lang.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,
                                 java.lang.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​(java.lang.Object containerID)

      Specified by:
        `setContainerID` in interface `InternalCDORevision`

    - #### setContainingFeatureID

          public void setContainingFeatureID​(int containingFeatureID)

      Specified by:
        `setContainingFeatureID` in interface `InternalCDORevision`

    - #### toArray

          public java.lang.Object[] toArray​(EStructuralFeature feature)

      Specified by:
        `toArray` in interface `CDORevisionData`

    - #### add

          public void add​(EStructuralFeature feature,
                          int index,
                          java.lang.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 java.lang.Object move​(EStructuralFeature feature,
                                       int targetIndex,
                                       int sourceIndex)

      Specified by:
        `move` in interface `InternalCDORevision`

    - #### remove

          public java.lang.Object remove​(EStructuralFeature feature,
                                         int index)

      Specified by:
        `remove` in interface `InternalCDORevision`

    - #### set

          public java.lang.Object set​(EStructuralFeature feature,
                                      int index,
                                      java.lang.Object value)

      Specified by:
        `set` in interface `InternalCDORevision`

    - #### unset

          public void unset​(EStructuralFeature feature)

      Specified by:
        `unset` in interface `InternalCDORevision`

    - #### getValue

          public java.lang.Object getValue​(EStructuralFeature feature)

      Description copied from interface: `InternalCDORevision`
      Should never return `CDORevisionData.NIL`
      Specified by:
        `getValue` in interface `InternalCDORevision`

    - #### setValue

          public java.lang.Object setValue​(EStructuralFeature feature,
                                           java.lang.Object value)

      Specified by:
        `setValue` in interface `InternalCDORevision`

    - #### setList

          public void setList​(EStructuralFeature feature,
                              InternalCDOList list)

      Specified by:
        `setList` in interface `InternalCDORevision`

    - #### getList

          @Deprecated
          public CDOList getList​(EStructuralFeature feature)

      Deprecated.
      Specified by:
        `getList` in interface `InternalCDORevision`

    - #### getList

          @Deprecated
          public CDOList getList​(EStructuralFeature feature,
                                 int initialCapacity)

      Deprecated.
      Specified by:
        `getList` in interface `InternalCDORevision`

    - #### getListOrNull

          public CDOList getListOrNull​(EStructuralFeature feature)

      Specified by:
        `getListOrNull` in interface `InternalCDORevision`

    - #### getOrCreateList

          public CDOList getOrCreateList​(EStructuralFeature feature)

      Description copied from interface: `InternalCDORevision`
      Same as `getOrCreateList(feature, 0)`.

      Warning: Must be used with caution because list creation for an `unsettable` feature implies a transition from UNSET to SET!

      Specified by:
        `getOrCreateList` in interface `InternalCDORevision`

    - #### getOrCreateList

          public CDOList getOrCreateList​(EStructuralFeature feature,
                                         int size)

      Description copied from interface: `InternalCDORevision`
      Returns the list that represents the passed feature, possibly creates it if needed.

      Warning: Must be used with caution because list creation for an `unsettable` feature implies a transition from UNSET to SET!

      Specified by:
        `getOrCreateList` 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.
      See Also:
        `InternalCDORevision.DO_NOT_CREATE_LIST`

    - #### read

          public void read​(CDODataInput in)
                    throws java.io.IOException

      Specified by:
        `read` in interface `InternalCDORevision`
      Throws:
        `java.io.IOException`

    - #### readValues

          public boolean readValues​(CDODataInput in)
                             throws java.io.IOException

      Specified by:
        `readValues` in interface `InternalCDORevision`
      Throws:
        `java.io.IOException`
      Since:
        4.3

    - #### write

          public void write​(CDODataOutput out,
                            int referenceChunk)
                     throws java.io.IOException

      Specified by:
        `write` in interface `InternalCDORevision`
      Throws:
        `java.io.IOException`

    - #### write

          public void write​(CDODataOutput out,
                            int referenceChunk,
                            CDOBranchPoint securityContext)
                     throws java.io.IOException

      Specified by:
        `write` in interface `InternalCDORevision`
      Throws:
        `java.io.IOException`
      Since:
        4.1

    - #### writeValues

          public void writeValues​(CDODataOutput out,
                                  int referenceChunk)
                           throws java.io.IOException

      Specified by:
        `writeValues` in interface `InternalCDORevision`
      Throws:
        `java.io.IOException`
      Since:
        4.3

    - #### convertEObjects

          public void convertEObjects​(CDOIDProvider oidProvider)

      Specified by:
        `convertEObjects` in interface `InternalCDORevision`

    - #### clearValues

          public EStructuralFeature[] clearValues()

      Specified by:
        `clearValues` in interface `InternalCDORevision`
      Since:
        4.2

    - #### getResourceNodeName

          public java.lang.String getResourceNodeName()

      Specified by:
        `getResourceNodeName` in interface `InternalCDORevision`
      Since:
        4.3

    - #### 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

    - #### accept

          public void accept​(CDORevisionValueVisitor visitor)

      Specified by:
        `accept` in interface `CDORevisionData`
      Since:
        4.2

    - #### accept

          @Deprecated
          public void accept​(CDORevisionValueVisitor visitor,
                             org.eclipse.net4j.util.Predicate<EStructuralFeature> filter)

      Deprecated.
      Specified by:
        `accept` in interface `CDORevisionData`
      Since:
        4.2

    - #### accept

          public void accept​(CDORevisionValueVisitor visitor,
                             java.util.function.Predicate<EStructuralFeature> filter)

      Specified by:
        `accept` in interface `CDORevisionData`
      Since:
        4.2

    - #### bypassPermissionChecks

          public boolean bypassPermissionChecks​(boolean on)

      Description copied from interface: `InternalCDORevision`
      Enables or disables permission checking for this revision.

      This method is used on the client side if the framework changes the revision on another user's behalf, e.g., during invalidation or general revision copying. It's safe to offer this method on the client side because the server is always the permission checking authority (during load or commit).

      Specified by:
        `bypassPermissionChecks` in interface `InternalCDORevision`
      Since:
        4.3

    - #### isListPreserving

          public boolean isListPreserving()

      Specified by:
        `isListPreserving` in interface `InternalCDORevision`
      Since:
        4.3

    - #### setListPreserving

          public void setListPreserving()

      Description copied from interface: `InternalCDORevision`
      The default behavior of a revision for calls to the `InternalCDORevision.clear(EStructuralFeature)` and `InternalCDORevision.unset(EStructuralFeature)` methods is to set the feature's value to null (discarding the value itself, a List). By calling this `InternalCDORevision.setListPreserving()` method the default behavior is changed; instead of setting the feature's value to null, the `List.clear()` method is called on the feature's list instance.
      Specified by:
        `setListPreserving` in interface `InternalCDORevision`
      Since:
        4.3

    - #### freeze

          public void freeze()

      Specified by:
        `freeze` in interface `InternalCDORevision`
      Since:
        4.0

    - #### isFrozen

          public boolean isFrozen()

      Specified by:
        `isFrozen` in interface `InternalCDORevision`
      Since:
        4.2

    - #### 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