Package org.jquantlib.quotes

Examples of org.jquantlib.quotes.RelinkableHandle


  public void testObservableHandle() {

    QL.info("Testing observability of quote handles...");

      final SimpleQuote me1 = new SimpleQuote(0.0);
      final RelinkableHandle<Quote> h = new RelinkableHandle(me1);

      final Flag f = new Flag();
      h.addObserver(f);

      me1.setValue(3.14);
      if (!f.isUp()) {
            fail("Observer was not notified of quote change");
        }

      f.lower();
      final SimpleQuote me2 = new SimpleQuote(0.0);

      h.linkTo(me2);
      if (!f.isUp()) {
            fail("Observer was not notified of quote change");
        }
  }
View Full Code Here

TOP

Related Classes of org.jquantlib.quotes.RelinkableHandle

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.