Package org.jfree.date

Examples of org.jfree.date.SpreadsheetDate


    /**
     * Create a date for 01-Feb-2000: the serial number should be 36557.
     */
    public void test01Feb2000ToSerial() {
        final SpreadsheetDate d = new SpreadsheetDate(1, MonthConstants.FEBRUARY, 2000);
        assertEquals(36557, d.toSerial());
    }
View Full Code Here


    /**
     * Create a date for 28-Feb-2000: the serial number should be 36584.
     */
    public void test28Feb2000ToSerial() {
        final SpreadsheetDate d = new SpreadsheetDate(28, MonthConstants.FEBRUARY, 2000);
        assertEquals(36584, d.toSerial());
    }
View Full Code Here

    /**
     * Create a date for 29-Feb-2000: the serial number should be 36585.
     */
    public void test29feb2000ToSerial() {
        final SpreadsheetDate d = new SpreadsheetDate(29, MonthConstants.FEBRUARY, 2000);
        assertEquals(36585, d.toSerial());
    }
View Full Code Here

    /**
     * Create a date for 1-Mar-2000: the serial number should be 36586.
     */
    public void test1mar2000ToSerial() {
        final SpreadsheetDate d = new SpreadsheetDate(1, MonthConstants.MARCH, 2000);
        assertEquals(36586, d.toSerial());
    }
View Full Code Here

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        final SpreadsheetDate d1 = new SpreadsheetDate(15, 4, 2000);
        SpreadsheetDate d2 = null;

        try {
            final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            final ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(d1);
View Full Code Here

    /**
     * Setup.
     */
    protected void setUp() {
        this.jan1Y1900 = new SpreadsheetDate(1, MonthConstants.JANUARY, 1900);
        this.s2 = new SpreadsheetDate(2);
    }
View Full Code Here

    /**
     * 12 November 2001 is a Monday.
     */
    public void test12Nov2001GetDayOfWeek() {
        final SerialDate nov12Y2001 = new SpreadsheetDate(12, MonthConstants.NOVEMBER, 2001);
        final int dayOfWeek = nov12Y2001.getDayOfWeek();
        assertEquals(SerialDate.MONDAY, dayOfWeek);
    }
View Full Code Here

    /**
     * Day 37986 is 31 Dec 2003.
     */
    public void test37986() {
        final SpreadsheetDate d = new SpreadsheetDate(37986);
        assertEquals(31, d.getDayOfMonth());
        assertEquals(MonthConstants.DECEMBER, d.getMonth());
        assertEquals(2003, d.getYYYY());
    }
View Full Code Here

    /**
     * Day 37987 is 1 Jan 2004.
     */
    public void test37987() {
        final SpreadsheetDate d = new SpreadsheetDate(37987);
        assertEquals(1, d.getDayOfMonth());
        assertEquals(MonthConstants.JANUARY, d.getMonth());
        assertEquals(2004, d.getYYYY());
    }
View Full Code Here

    /**
     * Day 38352 is 31 Dec 2004.
     */
    public void test38352() {
        final SpreadsheetDate d = new SpreadsheetDate(38352);
        assertEquals(31, d.getDayOfMonth());
        assertEquals(MonthConstants.DECEMBER, d.getMonth());
        assertEquals(2004, d.getYYYY());
    }
View Full Code Here

TOP

Related Classes of org.jfree.date.SpreadsheetDate

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.