@Test public void createHour() throws Exception { DateTimePeriod period0 = DateTimePeriod.createHour(2009, 2, 1, 9, DateTimeZone.UTC); DateTimePeriod period1 = DateTimePeriod.createHour(new DateTime(2009,2,1,9,0,0,0,DateTimeZone.UTC)); DateTimePeriod period2 = DateTimePeriod.create(DateTimeDuration.HOUR, new DateTime(2009,2,1,9,0,0,0,DateTimeZone.UTC)); DateTime correctStart = new DateTime(2009,2,1,9,0,0,0,DateTimeZone.UTC); DateTime correctEnd = new DateTime(2009,2,1,10,0,0,0,DateTimeZone.UTC); Assert.assertEquals(correctStart, period0.getStart()); Assert.assertEquals(correctEnd, period0.getEnd()); Assert.assertEquals(DateTimeDuration.HOUR, period0.getDuration()); Assert.assertEquals("2009-02-01-09", period0.getKey()); Assert.assertEquals("February 1, 2009 09:00", period0.getLongName()); Assert.assertEquals("09:00", period0.getShortName()); Assert.assertEquals("09", period0.getIndexName()); Assert.assertEquals(correctStart, period1.getStart()); Assert.assertEquals(correctEnd, period1.getEnd()); Assert.assertEquals(DateTimeDuration.HOUR, period1.getDuration()); Assert.assertEquals("2009-02-01-09", period1.getKey()); Assert.assertEquals("February 1, 2009 09:00", period0.getLongName()); Assert.assertEquals("09:00", period0.getShortName()); Assert.assertEquals("09", period0.getIndexName()); Assert.assertEquals(correctStart, period2.getStart()); Assert.assertEquals(correctEnd, period2.getEnd()); Assert.assertEquals(DateTimeDuration.HOUR, period2.getDuration()); Assert.assertEquals("2009-02-01-09", period2.getKey()); Assert.assertEquals("February 1, 2009 09:00", period0.getLongName()); Assert.assertEquals("09:00", period0.getShortName()); Assert.assertEquals("09", period0.getIndexName()); }
static public DateTimePeriod createHour(int year, int month, int day, int hour, DateTimeZone zone) { DateTime start = new DateTime(year, month, day, hour, 0, 0, 0, zone); return createHour(start); }
DateTimePeriod { static public DateTimePeriod createHour(int year, int month, int day, int hour, DateTimeZone zone) { DateTime start = new DateTime(year, month, day, hour, 0, 0, 0, zone); return createHour(start); } }
DateTimePeriod { static public DateTimePeriod createHour(int year, int month, int day, int hour, DateTimeZone zone) { DateTime start = new DateTime(year, month, day, hour, 0, 0, 0, zone); return createHour(start); } protected  DateTimePeriod(DateTime start, DateTime end, DateTimeDuration duration, String keyPattern,
            String longNamePattern, String shortNamePattern, String indexNamePattern); }
DateTimePeriod { static public DateTimePeriod createHour(int year, int month, int day, int hour, DateTimeZone zone) { DateTime start = new DateTime(year, month, day, hour, 0, 0, 0, zone); return createHour(start); } protected  DateTimePeriod(DateTime start, DateTime end, DateTimeDuration duration, String keyPattern,
            String longNamePattern, String shortNamePattern, String indexNamePattern); DateTime getStart(); DateTime getEnd(); DateTimeDuration getDuration(); String getKey(); String getLongName(); String getShortName(); String getIndexName(); abstract DateTimePeriod getNext(); abstract DateTimePeriod getPrevious(); abstract DateTimeDuration getDefaultSubDuration(); List<DateTimePeriod> toPeriods(DateTimeDuration duration); List<DateTimePeriod> toFiveMinutes(); List<DateTimePeriod> toHours(); List<DateTimePeriod> toDays(); List<DateTimePeriod> toMonths(); List<DateTimePeriod> toYears(); @Override boolean equals(Object object); @Override int hashCode(); static DateTimePeriod create(DateTimeDuration duration, DateTime start); static DateTimePeriod createYear(int year, DateTimeZone zone); static DateTimePeriod createYear(DateTime start); static DateTimePeriod createMonth(int year, int month, DateTimeZone zone); static DateTimePeriod createMonth(DateTime start); static DateTimePeriod createDay(int year, int month, int day, DateTimeZone zone); static DateTimePeriod createDay(DateTime start); static DateTimePeriod createHour(int year, int month, int day, int hour, DateTimeZone zone); static DateTimePeriod createHour(DateTime start); static DateTimePeriod createFiveMinutes(int year, int month, int day, int hour, int minute, DateTimeZone zone); static DateTimePeriod createFiveMinutes(DateTime start); static List<DateTimePeriod> createLastYearMonths(DateTimeZone zone); }
DateTimePeriod { static public DateTimePeriod createHour(int year, int month, int day, int hour, DateTimeZone zone) { DateTime start = new DateTime(year, month, day, hour, 0, 0, 0, zone); return createHour(start); } protected  DateTimePeriod(DateTime start, DateTime end, DateTimeDuration duration, String keyPattern,
            String longNamePattern, String shortNamePattern, String indexNamePattern); DateTime getStart(); DateTime getEnd(); DateTimeDuration getDuration(); String getKey(); String getLongName(); String getShortName(); String getIndexName(); abstract DateTimePeriod getNext(); abstract DateTimePeriod getPrevious(); abstract DateTimeDuration getDefaultSubDuration(); List<DateTimePeriod> toPeriods(DateTimeDuration duration); List<DateTimePeriod> toFiveMinutes(); List<DateTimePeriod> toHours(); List<DateTimePeriod> toDays(); List<DateTimePeriod> toMonths(); List<DateTimePeriod> toYears(); @Override boolean equals(Object object); @Override int hashCode(); static DateTimePeriod create(DateTimeDuration duration, DateTime start); static DateTimePeriod createYear(int year, DateTimeZone zone); static DateTimePeriod createYear(DateTime start); static DateTimePeriod createMonth(int year, int month, DateTimeZone zone); static DateTimePeriod createMonth(DateTime start); static DateTimePeriod createDay(int year, int month, int day, DateTimeZone zone); static DateTimePeriod createDay(DateTime start); static DateTimePeriod createHour(int year, int month, int day, int hour, DateTimeZone zone); static DateTimePeriod createHour(DateTime start); static DateTimePeriod createFiveMinutes(int year, int month, int day, int hour, int minute, DateTimeZone zone); static DateTimePeriod createFiveMinutes(DateTime start); static List<DateTimePeriod> createLastYearMonths(DateTimeZone zone);  }