001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.util;
016    
017    import com.liferay.portal.kernel.util.CalendarFactory;
018    
019    import java.util.Calendar;
020    import java.util.GregorianCalendar;
021    import java.util.Locale;
022    import java.util.TimeZone;
023    
024    /**
025     * @author Brian Wing Shun Chan
026     */
027    public class CalendarFactoryImpl implements CalendarFactory {
028    
029            public Calendar getCalendar() {
030                    return new GregorianCalendar();
031            }
032    
033            public Calendar getCalendar(int year, int month, int date) {
034                    return new GregorianCalendar(year, month, date);
035            }
036    
037            public Calendar getCalendar(
038                    int year, int month, int date, int hour, int minute) {
039    
040                    return new GregorianCalendar(year, month, date, hour, minute);
041            }
042    
043            public Calendar getCalendar(
044                    int year, int month, int date, int hour, int minute, int second) {
045    
046                    return new GregorianCalendar(year, month, date, hour, minute, second);
047            }
048    
049            public Calendar getCalendar(Locale locale) {
050                    return new GregorianCalendar(locale);
051            }
052    
053            public Calendar getCalendar(TimeZone timeZone) {
054                    return new GregorianCalendar(timeZone);
055            }
056    
057            public Calendar getCalendar(TimeZone timeZone, Locale locale) {
058                    return new GregorianCalendar(timeZone, locale);
059            }
060    
061    }