Package ch.uzh.ifi.seal.changedistiller.treedifferencing.operation

Examples of ch.uzh.ifi.seal.changedistiller.treedifferencing.operation.MoveOperation


                    // A. Let z be the partner of y in M'
                    // Node z /*T1*/= (Node) fRightToLeftMatchPrime.get(y); already executed
                    // B. k <- FindPos(x)
                    int k = findPosition(x);
                    // C. Append MOV(w, z, k) to E
                    TreeEditOperation move = new MoveOperation(w, x, z, k);
                    fEditScript.add(move);
                    // D. Apply MOV(w, z, k) to T1
                    move.apply();
                }
            }
            // (d) AlignChildren(w, x)
            if (!w.isLeaf()) {
                alignChildren(w, x);
View Full Code Here


                    if (!b.isInOrder() && matchContains(a, b, fMatch)) { // b not in S and (a, b) in M
                        // (a) k <- FindPos(b)
                        int k = findPosition(b);
                        // (b)
                        // Append MOV(a, w, k) to E
                        TreeEditOperation move = new MoveOperation(a, b, w, k);
                        fEditScript.add(move);
                        // Apply MOV(a, w, k) to T1
                        move.apply();
                        // (c) Mark a and b "in order"
                        a.enableInOrder();
                        b.enableInOrder();
                    }
                }
View Full Code Here

        addToNode(ifStatementRight, ASSIGNMENT, "b = a;");
        createEditScript();
        assertThat(fEditScript.size(), is(1));
        TreeEditOperation operation = fEditScript.get(0);
        assertThat(operation.getOperationType(), is(OperationType.MOVE));
        MoveOperation move = (MoveOperation) operation;
        assertThat(move.getOldParent(), is(fRootLeft));
        assertThat(move.getNewParent().getLabel(), is(ifStatementRight.getLabel()));
        assertThat(move.getNewParent().getValue(), is(ifStatementRight.getValue()));
        assertThat(move.getNodeToMove(), is(methodInvocation));
        assertThat(move.getNewNode().getLabel(), is(methodInvocation.getLabel()));
        assertThat(move.getNewNode().getValue(), is(methodInvocation.getValue()));
    }
View Full Code Here

TOP

Related Classes of ch.uzh.ifi.seal.changedistiller.treedifferencing.operation.MoveOperation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.