Example usage for org.jfree.data.time Month getEnd

List of usage examples for org.jfree.data.time Month getEnd

Introduction

In this page you can find the example usage for org.jfree.data.time Month getEnd.

Prototype

@Override
public Date getEnd() 

Source Link

Document

Returns the date/time that marks the end of the time period.

Usage

From source file:de.forsthaus.backend.dao.impl.SecLoginlogDAOImpl.java

@Override
public ListLongSumBean<DummyBean> getMonthlyCountByCountries(int aMonth, int aYear) {

    /**//from w  ww .j  av  a 2s  .  com
     * we set the dateFrom time manually to hh/mm/ss = 00:00:01 and the
     * dateTo time manually to date + hh/mm/SS = 23:59:59.<br>
     * The same with the day/month/year .<br>
     */
    Month month = new Month(aMonth + 1, aYear);
    Date dateFrom = month.getStart();
    Date dateTo = month.getEnd();

    String str1 = " SELECT distinct (countrycode.ccdCode2), countrycode.ccdName, count(*) as count ";
    String str2 = " FROM Ip2Country AS log_ip2country, CountryCode AS countrycode ";
    String str3 = " , SecLoginlog as secLoginLog ";
    String str4 = " WHERE secLoginLog.ip2Country = log_ip2country.id ";
    String str5 = " AND log_ip2country.countryCode = countrycode.id ";
    String str6 = " AND secLoginLog.lglLogtime BETWEEN ? and ? ";
    String str7 = " GROUP BY countrycode.ccdCode2, countrycode.ccdName ORDER BY count(*) desc ";
    String hqlStr = str1 + str2 + str3 + str4 + str5 + str6 + str7;

    Object[] params = { dateFrom, dateTo };

    return new ListLongSumBean<DummyBean>(
            CustomDataAccessUtils.transfer2Bean(getHibernateTemplate().find(hqlStr, params), DummyBean.class,
                    "country", "countryName", "totalCount"));
}

From source file:org.jfree.data.time.MonthTest.java

/**
 * Some checks for the getEnd() method.//from   ww w  .j a va2  s. c  om
 */
@Test
public void testGetEnd() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.ITALY);
    Calendar cal = Calendar.getInstance(Locale.ITALY);
    cal.set(2006, Calendar.JANUARY, 31, 23, 59, 59);
    cal.set(Calendar.MILLISECOND, 999);
    Month m = new Month(1, 2006);
    assertEquals(cal.getTime(), m.getEnd());
    Locale.setDefault(saved);
}

From source file:org.jfree.data.time.junit.MonthTest.java

/**
 * Some checks for the getEnd() method.//  w w  w .  ja va2s .c om
 */
public void testGetEnd() {
    Locale saved = Locale.getDefault();
    Locale.setDefault(Locale.ITALY);
    Calendar cal = Calendar.getInstance(Locale.ITALY);
    cal.set(2006, Calendar.JANUARY, 31, 23, 59, 59);
    cal.set(Calendar.MILLISECOND, 999);
    Month m = new Month(1, 2006);
    assertEquals(cal.getTime(), m.getEnd());
    Locale.setDefault(saved);
}