Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorisikm2008-06-14 17:30:48 -0400
committerisikm2008-06-14 17:30:48 -0400
commit35623abea312cb2664cb46eb7f095960656655d1 (patch)
treece0cc99c1eb6e6dd482de2209100ea8b3e7f42dd
parent3391a6904f71b5c60aaf0caaca545f4c91c12e0a (diff)
downloadorg.eclipse.ecf-35623abea312cb2664cb46eb7f095960656655d1.tar.gz
org.eclipse.ecf-35623abea312cb2664cb46eb7f095960656655d1.tar.xz
org.eclipse.ecf-35623abea312cb2664cb46eb7f095960656655d1.zip
updated comments and javadoc
-rw-r--r--framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/cola/ColaInsertion.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/cola/ColaInsertion.java b/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/cola/ColaInsertion.java
index 2806db55b..64cd9fea1 100644
--- a/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/cola/ColaInsertion.java
+++ b/framework/bundles/org.eclipse.ecf.docshare/src/org/eclipse/ecf/docshare/cola/ColaInsertion.java
@@ -32,6 +32,16 @@ public class ColaInsertion implements TransformationStrategy {
return INSTANCE;
}
+ /**
+ * Resolves two conflicting <code>ColaUpdateMessage</code>s by applying an appropriate operational transform.
+ *
+ * If necessary, modifies <code>localAppliedMsg</code> as well to reflect knowledge of <code>remoteIncomingMsg</code>
+ * in case more conflicting/further diverging remote messages arrive.
+ *
+ * @param remoteIncomingMsg message originating from remote site, generated on same document state as <code>localAppliedMsg</code>
+ * @param localAppliedMsg message already applied to local document, generation state corresponds to that of <code>remoteIncomingMsg</code>
+ * @return operational transform of remote message, not conflicting with applied local message
+ */
public ColaUpdateMessage getOperationalTransform(ColaUpdateMessage remoteIncomingMsg, ColaUpdateMessage localAppliedMsg, boolean localMsgHighPrio) {
Trace.entering(Activator.PLUGIN_ID, DocshareDebugOptions.METHODS_ENTERING, this.getClass(), "getOperationalTransform", new Object[] {remoteIncomingMsg, localAppliedMsg, new Boolean(localMsgHighPrio)}); //$NON-NLS-1$
@@ -44,12 +54,16 @@ public class ColaInsertion implements TransformationStrategy {
//coopt(remote(low),local(high)) --> (remote(low),local(low + high))
localAppliedMsg.setOffset(localAppliedMsg.getOffset() + remoteTransformedMsg.getOffset());
} else if (remoteTransformedMsg.getOffset() == localAppliedMsg.getOffset()) {
+ //coopt(remote(same),local(same))
if (localMsgHighPrio) {
+ //at owner --> (remote(high),local(same))
remoteTransformedMsg.setOffset(remoteTransformedMsg.getOffset() + localAppliedMsg.getText().length());
} else {
+ //at participant --> (remote(same),local(high))
localAppliedMsg.setOffset(localAppliedMsg.getOffset() + remoteTransformedMsg.getText().length());
}
} else if (remoteTransformedMsg.getOffset() > localAppliedMsg.getOffset()) {
+ //coopt(remote(high),local(low)) --> (remote(low + high),local(low))
remoteTransformedMsg.setOffset(remoteTransformedMsg.getOffset() + localAppliedMsg.getText().length());
}
}

Back to the top