Package org.jquantlib.time

Examples of org.jquantlib.time.Date$ISODate


        //

        @Override
        public void validate() {
            super.validate();
            final Date exerciseDate = exercise.lastDate();
            for (int i = 0; i < cashFlow.size(); i++) {
                final Date d = cashFlow.get(i).date();
                QL.require(d.le(exerciseDate), "dividend date later than the exercise date"); // QA:[RG]::verified // TODO: message
            }
        }
View Full Code Here


            Collections.sort(cashflows_, new EarlierThanCashFlowComparator());
            maturityDate_ = coupons.get(coupons.size() - 1).date();
            addRedemptionsToCashflows();
        }

        final Date evaluationDate = new Settings().evaluationDate();
        evaluationDate.addObserver(this);
    }
View Full Code Here

    }

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

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

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

        if (!cashflows.isEmpty()) {
            notionalSchedule_.add(new Date());
            notionals_.add(faceAmount);

            notionalSchedule_.add(maturityDate);
            notionals_.add(0.0);

            final CashFlow last = cashflows.last();
            redemptions_.add(last);

            // sort cashflows, except last one
            cashflows.remove(last);
            Collections.sort(cashflows, new EarlierThanCashFlowComparator());

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

        final Date evaluationDate = new Settings().evaluationDate();
        evaluationDate.addObserver(this);
    }
View Full Code Here

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

            final /* @Natural */int settlementDays,
            final Calendar calendar,
            final /* @Real */double faceAmount,
            final Date maturityDate,
            final Leg cashflows) {
        this(settlementDays, calendar, faceAmount, maturityDate, new Date(), cashflows);
    }
View Full Code Here

        this.notionals_ = new ArrayList<Double>();
        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

        return notionals_;
    }

    /** Note: new Date() as default argument. */
    public /* @Real */double notional(){
         return notional(new Date());
    }
View Full Code Here

        QL.require(redemptions_.size() == 1 , "multiple redemption cash flows given"); // QA:[RG]::verified // TODO: message
        return cashflows_.get(cashflows_.size() - 1);
    }

    public Date maturityDate() {
        if (maturityDate_.equals(new Date()))
            return maturityDate_;
        else
            return cashflows().get(cashflows().size() - 1).date();

    }
View Full Code Here

TOP

Related Classes of org.jquantlib.time.Date$ISODate

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.