Class BaseCDORevision
- java.lang.Object
-
- org.eclipse.emf.cdo.spi.common.revision.AbstractCDORevision
-
- org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision
-
- All Implemented Interfaces:
CDOBranchPoint,CDOBranchProvider,CDOBranchVersion,CDOIdentifiable,CDOIDAndVersion,CDORevisable,CDORevision,CDORevisionData,CDORevisionKey,CDOTimeProvider,CDOVersionProvider,CDOBranchAdjustable,CDOReferenceAdjustable,InternalCDORevision
public abstract class BaseCDORevision 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
- No Extend
- This class is not intended to be subclassed by clients.
-
-
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 protectedBaseCDORevision(BaseCDORevision source)BaseCDORevision(org.eclipse.emf.ecore.EClass eClass)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(org.eclipse.emf.ecore.EStructuralFeature feature, int index, java.lang.Object value)voidadjustBranches(CDOBranchManager newBranchManager)booleanadjustReferences(CDOReferenceAdjuster referenceAdjuster)booleanbypassPermissionChecks(boolean on)Enables or disables permission checking for this revision.static voidcheckNoFeatureMap(org.eclipse.emf.ecore.EStructuralFeature feature)Deprecated.As of 4.5feature mapsare no longer supported.voidclear(org.eclipse.emf.ecore.EStructuralFeature feature)org.eclipse.emf.ecore.EStructuralFeature[]clearValues()InternalCDORevisionDeltacompare(CDORevision origin)booleancontains(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)voidconvertEObjects(CDOIDProvider idProvider)protected abstract java.lang.ObjectdoGetValue(int featureIndex)protected abstract voiddoSetValue(int featureIndex, java.lang.Object value)static java.lang.StringformatFlags(BaseCDORevision revision)voidfreeze()java.lang.Objectget(org.eclipse.emf.ecore.EStructuralFeature feature, int index)InternalCDOBranchgetBranch()Returns the branch of this branch version.java.lang.ObjectgetContainerID()intgetContainingFeatureID()Provides the input to the calculation of the feature in the container revision that actually holds this revision.CDOIDgetID()CDOListgetListOrNull(org.eclipse.emf.ecore.EStructuralFeature feature)CDOListgetOrCreateList(org.eclipse.emf.ecore.EStructuralFeature feature)Same asgetOrCreateList(feature, 0).CDOListgetOrCreateList(org.eclipse.emf.ecore.EStructuralFeature feature, int size)Returns the list that represents the passed feature, possibly creates it if needed.CDOPermissiongetPermission()CDOIDgetResourceID()java.lang.StringgetResourceNodeName()longgetRevised()longgetTimeStamp()Returns the time stamp of this branch point, or the fixed special time stampunspecifiedif this branch point marks theheadof a branch.protected java.lang.ObjectgetValue(int featureIndex)java.lang.ObjectgetValue(org.eclipse.emf.ecore.EStructuralFeature feature)Should never returnCDORevisionData.NILintgetVersion()Returns the version number of this branch version.inthashCode(org.eclipse.emf.ecore.EStructuralFeature feature)intindexOf(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)protected abstract voidinitValues(org.eclipse.emf.ecore.EStructuralFeature[] allPersistentFeatures)booleanisEmpty(org.eclipse.emf.ecore.EStructuralFeature feature)booleanisFrozen()booleanisListPreserving()booleanisUnchunked()intlastIndexOf(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)voidmerge(CDORevisionDelta delta)java.lang.Objectmove(org.eclipse.emf.ecore.EStructuralFeature feature, int targetIndex, int sourceIndex)voidread(CDODataInput in)protected voidreadSystemValues(CDODataInput in)booleanreadValues(CDODataInput in)static java.lang.ObjectremapID(java.lang.Object value, java.util.Map<CDOID,CDOID> idMappings, boolean allowUnmappedTempIDs)java.lang.Objectremove(org.eclipse.emf.ecore.EStructuralFeature feature, int index)java.lang.Objectset(org.eclipse.emf.ecore.EStructuralFeature feature, int index, java.lang.Object value)voidsetBranchPoint(CDOBranchPoint branchPoint)voidsetContainerID(java.lang.Object containerID)voidsetContainingFeatureID(int containingFeatureID)voidsetID(CDOID id)voidsetList(org.eclipse.emf.ecore.EStructuralFeature feature, InternalCDOList list)voidsetListPreserving()The default behavior of a revision for calls to theInternalCDORevision.clear(EStructuralFeature)andInternalCDORevision.unset(EStructuralFeature)methods is to set the feature's value to null (discarding the value itself, a List).voidsetPermission(CDOPermission permission)voidsetResourceID(CDOID resourceID)voidsetRevised(long revised)voidsetUnchunked()protected voidsetValue(int featureIndex, java.lang.Object value)java.lang.ObjectsetValue(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)voidsetVersion(int version)intsize(org.eclipse.emf.ecore.EStructuralFeature feature)java.lang.Object[]toArray(org.eclipse.emf.ecore.EStructuralFeature feature)<T> T[]toArray(org.eclipse.emf.ecore.EStructuralFeature feature, T[] array)voidunfreeze()voidunset(org.eclipse.emf.ecore.EStructuralFeature feature)voidwrite(CDODataOutput out, int referenceChunk)voidwrite(CDODataOutput out, int referenceChunk, CDOBranchPoint securityContext)protected voidwriteSystemValues(CDODataOutput out)voidwriteValues(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
-
Methods inherited from interface org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision
copy
-
-
-
-
Constructor Detail
-
BaseCDORevision
public BaseCDORevision(org.eclipse.emf.ecore.EClass eClass)
- Since:
- 3.0
-
BaseCDORevision
protected BaseCDORevision(BaseCDORevision source)
-
-
Method Detail
-
read
public void read(CDODataInput in) throws java.io.IOException
- Throws:
java.io.IOException- Since:
- 3.0
-
readSystemValues
protected void readSystemValues(CDODataInput in) throws java.io.IOException
- Throws:
java.io.IOException- Since:
- 4.0
-
readValues
public boolean readValues(CDODataInput in) throws java.io.IOException
- Throws:
java.io.IOException- Since:
- 4.3
-
write
public void write(CDODataOutput out, int referenceChunk) throws java.io.IOException
- Throws:
java.io.IOException- Since:
- 4.0
-
write
public void write(CDODataOutput out, int referenceChunk, CDOBranchPoint securityContext) throws java.io.IOException
- Throws:
java.io.IOException- Since:
- 4.1
-
writeSystemValues
protected void writeSystemValues(CDODataOutput out) throws java.io.IOException
- Throws:
java.io.IOException- Since:
- 4.0
-
writeValues
public void writeValues(CDODataOutput out, int referenceChunk) throws java.io.IOException
- Throws:
java.io.IOException- Since:
- 4.3
-
convertEObjects
public void convertEObjects(CDOIDProvider idProvider)
- Since:
- 3.0
- See Also:
write(CDODataOutput, int)
-
getID
public CDOID getID()
-
setID
public void setID(CDOID id)
-
getBranch
public InternalCDOBranch getBranch()
Description copied from interface:CDOBranchVersionReturns the branch of this branch version.- Since:
- 4.2
-
getTimeStamp
public long getTimeStamp()
Description copied from interface:CDOBranchPointReturns the time stamp of this branch point, or the fixed special time stampunspecifiedif this branch point marks theheadof a branch.- Since:
- 3.0
-
setBranchPoint
public void setBranchPoint(CDOBranchPoint branchPoint)
- Since:
- 3.0
-
getVersion
public int getVersion()
Description copied from interface:CDOBranchVersionReturns the version number of this branch version.
-
setVersion
public void setVersion(int version)
-
getRevised
public long getRevised()
-
setRevised
public void setRevised(long revised)
-
compare
public InternalCDORevisionDelta compare(CDORevision origin)
-
merge
public void merge(CDORevisionDelta delta)
-
getResourceID
public CDOID getResourceID()
-
setResourceID
public void setResourceID(CDOID resourceID)
-
getContainerID
public java.lang.Object getContainerID()
-
setContainerID
public void setContainerID(java.lang.Object containerID)
-
getContainingFeatureID
public int getContainingFeatureID()
Description copied from interface:CDORevisionDataProvides 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()
-
setContainingFeatureID
public void setContainingFeatureID(int containingFeatureID)
-
hashCode
public int hashCode(org.eclipse.emf.ecore.EStructuralFeature feature)
-
get
public java.lang.Object get(org.eclipse.emf.ecore.EStructuralFeature feature, int index)
-
contains
public boolean contains(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)
-
indexOf
public int indexOf(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)
-
lastIndexOf
public int lastIndexOf(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)
-
isEmpty
public boolean isEmpty(org.eclipse.emf.ecore.EStructuralFeature feature)
-
size
public int size(org.eclipse.emf.ecore.EStructuralFeature feature)
-
toArray
public java.lang.Object[] toArray(org.eclipse.emf.ecore.EStructuralFeature feature)
-
toArray
public <T> T[] toArray(org.eclipse.emf.ecore.EStructuralFeature feature, T[] array)
-
add
public void add(org.eclipse.emf.ecore.EStructuralFeature feature, int index, java.lang.Object value)
-
clear
public void clear(org.eclipse.emf.ecore.EStructuralFeature feature)
-
move
public java.lang.Object move(org.eclipse.emf.ecore.EStructuralFeature feature, int targetIndex, int sourceIndex)
-
remove
public java.lang.Object remove(org.eclipse.emf.ecore.EStructuralFeature feature, int index)
-
set
public java.lang.Object set(org.eclipse.emf.ecore.EStructuralFeature feature, int index, java.lang.Object value)
-
unset
public void unset(org.eclipse.emf.ecore.EStructuralFeature feature)
-
adjustReferences
public boolean adjustReferences(CDOReferenceAdjuster referenceAdjuster)
- Since:
- 4.0
-
adjustBranches
public void adjustBranches(CDOBranchManager newBranchManager)
- Since:
- 4.3
-
getValue
public java.lang.Object getValue(org.eclipse.emf.ecore.EStructuralFeature feature)
Description copied from interface:InternalCDORevisionShould never returnCDORevisionData.NIL
-
setValue
public java.lang.Object setValue(org.eclipse.emf.ecore.EStructuralFeature feature, java.lang.Object value)
-
getListOrNull
public CDOList getListOrNull(org.eclipse.emf.ecore.EStructuralFeature feature)
- Since:
- 4.7
-
getOrCreateList
public CDOList getOrCreateList(org.eclipse.emf.ecore.EStructuralFeature feature)
Description copied from interface:InternalCDORevisionSame asgetOrCreateList(feature, 0).Warning: Must be used with caution because list creation for an
unsettablefeature implies a transition from UNSET to SET!
-
getOrCreateList
public CDOList getOrCreateList(org.eclipse.emf.ecore.EStructuralFeature feature, int size)
Description copied from interface:InternalCDORevisionReturns the list that represents the passed feature, possibly creates it if needed.Warning: Must be used with caution because list creation for an
unsettablefeature 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 returnnullin this case.- See Also:
InternalCDORevision.DO_NOT_CREATE_LIST
-
setList
public void setList(org.eclipse.emf.ecore.EStructuralFeature feature, InternalCDOList list)
-
clearValues
public org.eclipse.emf.ecore.EStructuralFeature[] clearValues()
- Since:
- 4.2
-
getResourceNodeName
public java.lang.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:InternalCDORevisionEnables 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:InternalCDORevisionThe default behavior of a revision for calls to theInternalCDORevision.clear(EStructuralFeature)andInternalCDORevision.unset(EStructuralFeature)methods is to set the feature's value to null (discarding the value itself, a List). By calling thisInternalCDORevision.setListPreserving()method the default behavior is changed; instead of setting the feature's value to null, theList.clear()method is called on the feature's list instance.- Since:
- 4.3
-
freeze
public void freeze()
- Since:
- 4.1
-
unfreeze
public void unfreeze()
- Since:
- 4.11
-
isFrozen
public boolean isFrozen()
- Since:
- 4.2
-
isUnchunked
public boolean isUnchunked()
- Since:
- 4.1
-
setUnchunked
public void setUnchunked()
- Since:
- 4.1
-
getValue
protected java.lang.Object getValue(int featureIndex)
-
setValue
protected void setValue(int featureIndex, java.lang.Object value)
-
initValues
protected abstract void initValues(org.eclipse.emf.ecore.EStructuralFeature[] allPersistentFeatures)
-
doGetValue
protected abstract java.lang.Object doGetValue(int featureIndex)
- Since:
- 4.1
-
doSetValue
protected abstract void doSetValue(int featureIndex, java.lang.Object value)- Since:
- 4.1
-
checkNoFeatureMap
@Deprecated public static void checkNoFeatureMap(org.eclipse.emf.ecore.EStructuralFeature feature)
Deprecated.As of 4.5feature mapsare no longer supported.
-
remapID
public static java.lang.Object remapID(java.lang.Object value, java.util.Map<CDOID,CDOID> idMappings, boolean allowUnmappedTempIDs)
-
formatFlags
public static java.lang.String formatFlags(BaseCDORevision revision)
- Since:
- 4.3
-
-