X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2Finternal%2FClusterUpdateProcessorBase2.java;fp=bundles%2Forg.simantics.acorn%2Fsrc%2Forg%2Fsimantics%2Facorn%2Finternal%2FClusterUpdateProcessorBase2.java;h=0000000000000000000000000000000000000000;hb=33b349001037197a526a49e5820f0317dc74d934;hp=502729c0bab20982ab82100038898dc815e47be5;hpb=18211711f14cc26e828f7c35420eabde871a336a;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterUpdateProcessorBase2.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterUpdateProcessorBase2.java deleted file mode 100644 index 502729c0b..000000000 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/internal/ClusterUpdateProcessorBase2.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.simantics.acorn.internal; - -import org.simantics.acorn.exception.IllegalAcornStateException; -import org.simantics.db.service.Bytes; -import org.simantics.db.service.ClusterUID; - -public abstract class ClusterUpdateProcessorBase2 { - - final private byte[] bytes; - private int pos = 0; - final private int len; - final private ClusterUID uid; - - public ClusterUpdateProcessorBase2(byte[] operations) { - this.bytes = operations; - this.len = Bytes.readLE4(bytes, 0) + 4; // whatta? - int version = Bytes.readLE4(bytes, 4); - assert(version == ClusterChange2.VERSION); - long cuid1 = Bytes.readLE8(bytes, 8); - long cuid2 = Bytes.readLE8(bytes, 16); - pos = 24; - uid = ClusterUID.make(cuid1, cuid2); - } - - public ClusterUID getClusterUID() { - return uid; - } - - private void processSetImmutable(int op) { - int value = bytes[pos++]&0xff; - setImmutable(value > 0); - } - - private void processUndoValue(int op) { - Bytes.readLE4(bytes, pos); - pos+=4; - } - - public void process() throws IllegalAcornStateException { - - while(pos < len) { - - int op = bytes[pos++]&0xff; - - switch(op) { - - case ClusterChange2.SET_IMMUTABLE_OPERATION: - processSetImmutable(op); - break; - case ClusterChange2.UNDO_VALUE_OPERATION: - processUndoValue(op); - break; - default: - throw new IllegalAcornStateException("Can not process cluster " + uid); - - } - } - } - - abstract void setImmutable(boolean value); - -}