Package org.jquantlib.time

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


        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


        // TODO: code review :: please verify against QL/C++ code
        // 1. seems like we should have this.evaluationDate
        // 2. we should get rid of static calls and singletons

        evaluationDate.addObserver(this);
        IndexManager.getInstance().notifier(name()).addObserver(this);
        //XXX:registerWith
        //registerWith(evaluationDate);
        //registerWith(IndexManager.getInstance().notifier(name()));
    }
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

        // 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

            maturityDate_ = coupons.get(coupons.size() - 1).date();
            addRedemptionsToCashflows();
        }

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

    protected Bond(
            final /* @Natural */int settlementDays,
            final Calendar calendar) {
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,
View Full Code Here

        this.notionalSchedule_ = new ArrayList<Date>();
        this.redemptions_ = new Leg();

        final Date evaluationDate = new Settings().evaluationDate();

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


    //
View Full Code Here

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

        this.index_.addObserver(this);
        evaluationDate.addObserver(this);
        //XXX:registerWith
        //registerWith(this.index_);
        //registerWith(evaluationDate);
    }
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.