Package org.reactfx

Examples of org.reactfx.Guard


        private final BooleanProperty b = new SimpleBooleanProperty();
        private final BooleanBinding output = BooleanBinding.wrap(a.and(b));

        @Override
        public void setInputs(boolean a, boolean b) {
            Guard guard = output.block();
            this.a.set(a);
            this.b.set(b);
            guard.close();
        }
View Full Code Here


        eagerTest.run();
        long t2 = System.currentTimeMillis();
        double eagerTime = (t2-t1)/1000.0;

        t1 = System.currentTimeMillis();
        Guard g = lazyResult.block();
        lazyTest.run();
        g.close();
        t2 = System.currentTimeMillis();
        double lazyTime = (t2-t1)/1000.0;

        System.out.println("EAGER TEST:");
        System.out.println("    fib_" + n + " = " + eagerResult.get());
View Full Code Here

        source.setValue(true);
        source.setValue(false);
        assertEquals(2, counter.getAndReset());

        Guard g = tested.block();
        source.setValue(true);
        source.setValue(false);
        g.close();
        assertEquals(1, counter.get());
    }
View Full Code Here

TOP

Related Classes of org.reactfx.Guard

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.