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

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


                // ii. Append INS((w, a, v(x)), z, k) to E, for a new identifier w.
                w = (Node) x.clone();
                w.enableMatched();
                x.enableMatched();
                TreeEditOperation insert = new InsertOperation(w, z, k);
                fEditScript.add(insert);

                // iii. Add (w, x) to M' and apply INS((w, a, v(x)), z, k) to T1
                addMatchToPrimes(x, w);
                insert.apply();

                // (c) else if x is not a root (x has a partner in M')
            } else if (!x.isRoot()) {
                // i.
                // Let w be the partner of x in M'
View Full Code Here


        Node methodInvocation = addToRight(METHOD_INVOCATION, "foo.bar();");
        createEditScript();
        assertThat(fEditScript.size(), is(1));
        TreeEditOperation operation = fEditScript.get(0);
        assertThat(operation.getOperationType(), is(OperationType.INSERT));
        InsertOperation insert = (InsertOperation) operation;
        assertThat(insert.getParentNode(), is(fRootLeft));
        assertThat(insert.getNodeToInsert().getLabel(), is(methodInvocation.getLabel()));
        assertThat(insert.getNodeToInsert().getValue(), is(methodInvocation.getValue()));
    }
View Full Code Here

    createEditScript();
   
    assertThat(fEditScript.size(), is(2));
    TreeEditOperation firstOperation = fEditScript.get(0);
    assertThat(firstOperation.getOperationType(), is(OperationType.INSERT));
    InsertOperation firstInsert = (InsertOperation) firstOperation;
    assertThat(firstInsert.getNodeToInsert().getLabel(), is(outerTryRight.getLabel()));
    assertThat(firstInsert.getNodeToInsert().getValue(), is(outerTryRight.getValue()));

    TreeEditOperation secondOperation = fEditScript.get(1);
    assertThat(secondOperation.getOperationType(), is(OperationType.INSERT));
    InsertOperation insert = (InsertOperation) secondOperation;
    assertThat(insert.getNodeToInsert().getLabel(), is(innerTryRight.getLabel()));
    assertThat(insert.getNodeToInsert().getValue(), is(innerTryRight.getValue()));
   
    assertThat(((Node)insert.getNodeToInsert().getParent()).getLabel(), is(innerTryRight.getLabel()));
    assertThat(((Node)insert.getNodeToInsert().getParent()).getValue(), is(innerTryRight.getValue()));
  }
View Full Code Here

TOP

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

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.