Package org.jfree.date

Examples of org.jfree.date.SerialDate


    /**
     * Problem 30/360ISDA day count.
     */
    public void testDayCount30ISDA() {
        final SerialDate d1 = SerialDate.createInstance(1, SerialDate.APRIL, 2002);
        final SerialDate d2 = SerialDate.createInstance(2, SerialDate.APRIL, 2002);
        final int count = SerialDateUtilities.dayCount30ISDA(d1, d2);
        assertEquals(1, count);
    }
View Full Code Here


    /**
     * Problem 30/360PSA day count.
     */
    public void testDayCount30PSA() {
        final SerialDate d1 = SerialDate.createInstance(1, SerialDate.APRIL, 2002);
        final SerialDate d2 = SerialDate.createInstance(2, SerialDate.APRIL, 2002);
        final int count = SerialDateUtilities.dayCount30PSA(d1, d2);
        assertEquals(1, count);
    }
View Full Code Here

    /**
     * Problem 30E/360 day count.
     */
    public void testDayCount3030E() {
        final SerialDate d1 = SerialDate.createInstance(1, SerialDate.APRIL, 2002);
        final SerialDate d2 = SerialDate.createInstance(2, SerialDate.APRIL, 2002);
        final int count = SerialDateUtilities.dayCount30E(d1, d2);
        assertEquals(1, count);
    }
View Full Code Here

    /**
     * 9 Nov 2001 plus two months should be 9 Jan 2002.
     */
    public void testAddMonthsTo9Nov2001() {
        final SerialDate jan9Y2002 = SerialDate.addMonths(2, this.nov9Y2001);
        final SerialDate answer = SerialDate.createInstance(9, 1, 2002);
        assertEquals(answer, jan9Y2002);
    }
View Full Code Here

    /**
     * A test case for a reported bug, now fixed.
     */
    public void testAddMonthsTo5Oct2003() {
        final SerialDate d1 = SerialDate.createInstance(5, SerialDate.OCTOBER, 2003);
        final SerialDate d2 = SerialDate.addMonths(2, d1);
        assertEquals(d2, SerialDate.createInstance(5, SerialDate.DECEMBER, 2003));
    }
View Full Code Here

    /**
     * A test case for a reported bug, now fixed.
     */
    public void testAddMonthsTo1Jan2003() {
        final SerialDate d1 = SerialDate.createInstance(1, SerialDate.JANUARY, 2003);
        final SerialDate d2 = SerialDate.addMonths(0, d1);
        assertEquals(d2, d1);

    }
View Full Code Here

    /**
     * Monday preceding Friday 9 November 2001 should be 5 November.
     */
    public void testMondayPrecedingFriday9Nov2001() {
        final SerialDate mondayBefore = SerialDate.getPreviousDayOfWeek(
            SerialDate.MONDAY, this.nov9Y2001
        );
        assertEquals(5, mondayBefore.getDayOfMonth());
    }
View Full Code Here

    /**
     * Monday following Friday 9 November 2001 should be 12 November.
     */
    public void testMondayFollowingFriday9Nov2001() {
        final SerialDate mondayAfter = SerialDate.getFollowingDayOfWeek(
            SerialDate.MONDAY, this.nov9Y2001
        );
        assertEquals(12, mondayAfter.getDayOfMonth());
    }
View Full Code Here

    /**
     * Monday nearest Friday 9 November 2001 should be 12 November.
     */
    public void testMondayNearestFriday9Nov2001() {
        final SerialDate mondayNearest = SerialDate.getNearestDayOfWeek(
            SerialDate.MONDAY, this.nov9Y2001
        );
        assertEquals(12, mondayNearest.getDayOfMonth());
    }
View Full Code Here

    /**
     * The Monday nearest to 22nd January 1970 falls on the 19th.
     */
    public void testMondayNearest22Jan1970() {
        final SerialDate jan22Y1970 = SerialDate.createInstance(22, SerialDate.JANUARY, 1970);
        final SerialDate mondayNearest = SerialDate.getNearestDayOfWeek(SerialDate.MONDAY, jan22Y1970);
        assertEquals(19, mondayNearest.getDayOfMonth());
    }
View Full Code Here

TOP

Related Classes of org.jfree.date.SerialDate

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.