Package ca.odell.glazedlists.impl.event

Examples of ca.odell.glazedlists.impl.event.Tree4Deltas


    /**
     * Make sure the deltas iterator works as expected.
     */
    public void testIterateByBlocks() {
        Tree4Deltas deltas = new Tree4Deltas();
        deltas.reset(10);
        deltas.targetInsert(3, 6, null);
        deltas.targetDelete(8, 10, ListEvent.UNKNOWN_VALUE);

        Tree4Deltas.Iterator iterator = deltas.iterator();
        assertEquals(true, iterator.hasNextNode());
        assertEquals(true, iterator.nextNode());
        assertEquals(3, iterator.getIndex());
        assertEquals(6, iterator.getEndIndex());
        assertEquals(ListEvent.INSERT, iterator.getType());
View Full Code Here


        assertEquals(false, iterator.hasNextNode());
    }
   
    public void testTargetChanges() {
        Tree4Deltas deltas = new Tree4Deltas();
        deltas.reset(10);
        assertEquals("__________", deltas.toString());

        deltas.targetDelete(5, 6, null);
        deltas.targetInsert(2, 3, null);
        deltas.targetUpdate(8, 9, null, null);

        assertEquals("__+___X__U_", deltas.toString());

        deltas.sourceInsert(0);
        assertEquals("___+___X__U_", deltas.toString());

        deltas.sourceDelete(0);
        assertEquals("__+___X__U_", deltas.toString());

        deltas.sourceDelete(8);
        assertEquals("__+___X___", deltas.toString());

        deltas.sourceDelete(5);
        assertEquals("__+______", deltas.toString());

        deltas.targetInsert(2, 6, null);
        assertEquals("__+++++______", deltas.toString());

        deltas.sourceInsert(8);
        assertEquals("__+++++_______", deltas.toString());
    }
View Full Code Here

TOP

Related Classes of ca.odell.glazedlists.impl.event.Tree4Deltas

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.