Package java.util

Examples of java.util.GregorianCalendar.clone()


  public static boolean isFuture(int month, int day, int year,
                   TimeZone timeZone, Locale locale) {

    Calendar curCal = new GregorianCalendar(timeZone, locale);

    Calendar cal = (Calendar)curCal.clone();
    cal.set(Calendar.MONTH, month);
    cal.set(Calendar.DATE, day);
    cal.set(Calendar.YEAR, year);

    return cal.after(curCal);
View Full Code Here


                   int hour, int minute, int amPm,
                   TimeZone timeZone, Locale locale) {

    Calendar curCal = new GregorianCalendar(timeZone, locale);

    Calendar cal = (Calendar)curCal.clone();
    cal.set(Calendar.MONTH, month);
    cal.set(Calendar.DATE, day);
    cal.set(Calendar.YEAR, year);
    cal.set(Calendar.HOUR, hour);
    cal.set(Calendar.MINUTE, minute);
View Full Code Here

        cal.set(2001, 0, 1, 0, 0, 0);
        cal.set(Calendar.MILLISECOND, 0);
        while (cal.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) {
            cal.add(Calendar.DATE, 1);
        }
        this.monday = (Calendar) cal.clone();

        // calculate 9am on the first Monday after 2001-01-01
        cal.add(Calendar.HOUR, 9);
        this.monday9am = (Calendar) cal.clone();
    }
View Full Code Here

        }
        this.monday = (Calendar) cal.clone();

        // calculate 9am on the first Monday after 2001-01-01
        cal.add(Calendar.HOUR, 9);
        this.monday9am = (Calendar) cal.clone();
    }

    /**
     * Tears down the fixture, for example, close a network connection.
     * This method is called after a test is executed.
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.