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

# Class StubCDORevision

java.lang.Object
org.eclipse.emf.cdo.spi.common.revision.AbstractCDORevision
org.eclipse.emf.cdo.spi.common.revision.StubCDORevision

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

Direct Known Subclasses:
  `SyntheticCDORevision`

public class StubCDORevision extends AbstractCDORevision
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
Modifier
Constructor
Description
`protected`
`StubCDORevision(InternalCDOClassInfo classInfo)`
``
`StubCDORevision(EClass eClass)`

## Method Summary

Modifier and Type
Method
Description
`void`
`add(EStructuralFeature feature, int index, Object value)`
`void`
`adjustBranches(CDOBranchManager newBranchManager)`
`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)`
`int`
`compareTo(CDOBranchPoint o)`
`boolean`
`contains(EStructuralFeature feature, Object value)`
`void`
`convertEObjects(CDOIDProvider oidProvider)`
`InternalCDORevision`
`copy()`
`void`
`freeze()`
`Object`
`get(EStructuralFeature feature, int index)`
`InternalCDOBranch`
`getBranch()`
Returns the branch of this branch version.
`Object`
`getContainerID()`
`int`
`getContainingFeatureID()`
Provides the input to the calculation of the feature in the container revision that actually holds this revision.
`CDOID`
`getID()`
`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()`
`CDOID`
`getResourceID()`
`String`
`getResourceNodeName()`
`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`
`isFrozen()`
`boolean`
`isListPreserving()`
`boolean`
`isUnchunked()`
`int`
`lastIndexOf(EStructuralFeature feature, Object value)`
`void`
`merge(CDORevisionDelta delta)`
`Object`
`move(EStructuralFeature feature, int targetIndex, int sourceIndex)`
`void`
`read(CDODataInput in)`
`boolean`
`readValues(CDODataInput in)`
`Object`
`remove(EStructuralFeature feature, int index)`
`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`
`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()`
`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)`
`void`
`writeValues(CDODataOutput out, int referenceChunk)`

### Methods inherited from class org.eclipse.emf.cdo.spi.common.revision.AbstractCDORevision

`accept, accept, accept, adjustForCommit, data, equals, getAllPersistentFeatures, getClassInfo, getEClass, getFeatureIndex, getList, getList, getProperRevision, getRevisionForID, hashCode, initClassInfo, isHistorical, isReadable, isResource, isResourceFolder, isResourceNode, isValid, isValid, isWritable, revision, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### StubCDORevision

public StubCDORevision(EClass eClass)

### StubCDORevision

protected StubCDORevision(InternalCDOClassInfo classInfo)

Since:
  4.2

## Method Details

### compareTo

public int compareTo(CDOBranchPoint o)

### setID

public void setID(CDOID id)

### setVersion

public void setVersion(int version)

### setBranchPoint

public void setBranchPoint(CDOBranchPoint branchPoint)

### setRevised

public void setRevised(long revised)

### setResourceID

public void setResourceID(CDOID resourceID)

### setContainerID

public void setContainerID(Object containerID)

### setContainingFeatureID

public void setContainingFeatureID(int containingFeatureID)

### add

public void add(EStructuralFeature feature, int index, Object value)

### clear

public void clear(EStructuralFeature feature)

### move

public Object move(EStructuralFeature feature, int targetIndex, int sourceIndex)

### remove

public Object remove(EStructuralFeature feature, int index)

### set

public Object set(EStructuralFeature feature, int index, Object value)

### unset

public void unset(EStructuralFeature feature)

### getValue

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

### setValue

public Object setValue(EStructuralFeature feature, Object value)

### setList

public void setList(EStructuralFeature feature, InternalCDOList list)

### getListOrNull

public CDOList getListOrNull(EStructuralFeature feature)

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

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

  `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 IOException

Throws:
  `IOException`

### readValues

public boolean readValues(CDODataInput in) throws IOException

Throws:
  `IOException`
Since:
  4.3

### write

public void write(CDODataOutput out, int referenceChunk) throws IOException

Throws:
  `IOException`

### write

public void write(CDODataOutput out, int referenceChunk, CDOBranchPoint securityContext) throws IOException

Throws:
  `IOException`
Since:
  4.1

### writeValues

public void writeValues(CDODataOutput out, int referenceChunk) throws IOException

Throws:
  `IOException`
Since:
  4.3

### convertEObjects

public void convertEObjects(CDOIDProvider oidProvider)

### getVersion

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

### getRevised

public long getRevised()

### compare

public InternalCDORevisionDelta compare(CDORevision origin)

### merge

public void merge(CDORevisionDelta delta)

### copy

public InternalCDORevision copy()

### getID

public CDOID getID()

### getBranch

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

Since:
  4.2

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

### getResourceID

public CDOID getResourceID()

### getContainerID

public Object getContainerID()

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

See Also:
  - `BasicEObjectImpl.eContainingFeature()`
  - `CDORevisionData.getContainerID()`

### get

public Object get(EStructuralFeature feature, int index)

### size

public int size(EStructuralFeature feature)

### isEmpty

public boolean isEmpty(EStructuralFeature feature)

### contains

public boolean contains(EStructuralFeature feature, Object value)

### indexOf

public int indexOf(EStructuralFeature feature, Object value)

### lastIndexOf

public int lastIndexOf(EStructuralFeature feature, Object value)

### toArray

public <T> T[] toArray(EStructuralFeature feature, T[] array)

### toArray

public Object[] toArray(EStructuralFeature feature)

### hashCode

public int hashCode(EStructuralFeature feature)

### adjustReferences

public boolean adjustReferences(CDOReferenceAdjuster referenceAdjuster)

Since:
  4.0

### adjustBranches

public void adjustBranches(CDOBranchManager newBranchManager)

Since:
  4.3

### clearValues

public EStructuralFeature[] clearValues()

Since:
  4.2

### getResourceNodeName

public String getResourceNodeName()

Since:
  4.3

### getPermission

public CDOPermission getPermission()

Since:
  4.1

### setPermission

public void setPermission(CDOPermission permission)

Since:
  4.1

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

Since:
  4.3

### isListPreserving

public boolean isListPreserving()

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.

Since:
  4.3

### freeze

public void freeze()

Since:
  4.0

### isFrozen

public boolean isFrozen()

Since:
  4.2

### isUnchunked

public boolean isUnchunked()

Since:
  4.1

### setUnchunked

public void setUnchunked()

Since:
  4.1