Package org.jquantlib.time

Examples of org.jquantlib.time.Date.addObserver()


        if (dayCounter_.empty())
            dayCounter_ = index.dayCounter();

        Date evaluationDate = new Settings().evaluationDate();
        this.index_.addObserver(this);
        evaluationDate.addObserver(this);
    }

    public void setPricer(final FloatingRateCouponPricer pricer){
        if (pricer_ != null) {
          pricer_.deleteObserver(this);
View Full Code Here


        // TODO: code review :: please verify against QL/C++ code
        // seems like we should have this.evaluationDate

        this.termStructure_.addObserver(this);
        evaluationDate.addObserver(this);
    }

    public CapFloor(
            final Type type,
            final Leg floatingLeg,
View Full Code Here

        // TODO: code review :: please verify against QL/C++ code
        // Seems like we should have this.evaluationDate

        this.termStructure_.addObserver(this);
        evaluationDate.addObserver(this);
    }

    public /*@Rate*/double atmRate(){
        return CashFlows.getInstance().atmRate(floatingLeg_, termStructure_);
    }
View Full Code Here

        }

        //TODO:Review translation of Settings.java. QL097 has singleton or session based instances of Settings.
        // Current implementation of Settings appears to be thread based
        final Date evaluationDate = new Settings().evaluationDate();
        evaluationDate.addObserver(this);
    }

    protected Bond(final /* @Natural */int settlementDays,
                 final Calendar calendar) {
        this(settlementDays, calendar, new Date(), new Leg());
View Full Code Here

            //now add last cashflow back to the last position
            cashflows.add(last);
        }

        final Date evaluationDate = new Settings().evaluationDate();
        evaluationDate.addObserver(this);
    }

    protected Bond(final /* @Natural */int settlementDays,
                 final Calendar calendar,
                 final /* @Real */double faceAmount,
View Full Code Here

        this.moving = true;
        this.updated = false;

        // observes date changes
        final Date today = new Settings().evaluationDate();
        today.addObserver(this);

        this.referenceDate = calendar.advance(today, settlementDays, TimeUnit.Days);
    }

View Full Code Here

        QL.info("Testing observability of dates using operation Date#subAssign()");

        final Date me = Date.todaysDate();
        final Flag f = new Flag();
        me.addObserver(f);
        me.subAssign(1);
        if (!f.isUp()) {
            fail("Observer was not notified of date change");
        }
    }
View Full Code Here

        QL.info("Testing observability of dates using operation Date#sub()");

        final Date me = Date.todaysDate();
        final Flag f = new Flag();
        me.addObserver(f);
        me.sub(1);
        if (f.isUp()) {
            fail("Observer was notified of date change whilst it was not expected");
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.