test_class.file: ch-commons-util/src/test/java/com/cloudhopper/commons/util/time/DateTimePeriodTest.java
test_class.identifier: DateTimePeriodTest
test_case.body: @Test
      public void toMonths() throws Exception {
          // 1 month
          DateTimePeriod period0 = DateTimePeriod.createMonth(2009, 1, DateTimeZone.UTC);
          List<DateTimePeriod> periods = period0.toMonths();
          Assert.assertArrayEquals(new DateTimePeriod[] {
                  DateTimePeriod.createMonth(2009, 1, DateTimeZone.UTC)
              }, periods.toArray(new DateTimePeriod[0]));
  
          // multiple months (a little more than 1 more month)
          period0 = new DateTimeMonth(new DateTime(2009,1,1,0,0,0,0,DateTimeZone.UTC), new DateTime(2009,3,1,1,0,0,0,DateTimeZone.UTC));
          periods = period0.toPeriods(DateTimeDuration.MONTH);
          Assert.assertArrayEquals(new DateTimePeriod[] {
                  DateTimePeriod.createMonth(2009, 1, DateTimeZone.UTC),
                  DateTimePeriod.createMonth(2009, 2, DateTimeZone.UTC)
              }, periods.toArray(new DateTimePeriod[0]));
  
          // no months (partial month such as a day)
          period0 = DateTimePeriod.createDay(2009, 1, 1, DateTimeZone.UTC);
          periods = period0.toMonths();
          Assert.assertArrayEquals(new DateTimePeriod[] {}, periods.toArray(new DateTimePeriod[0]));
      }
test_case.class_method_signature: DateTimePeriodTest.toMonths()
test_case.full_signature: @Test public void toMonths()
test_case.identifier: toMonths
test_case.invocations: createMonth toMonths assertArrayEquals createMonth toArray toPeriods assertArrayEquals createMonth createMonth toArray createDay toMonths assertArrayEquals toArray
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void toMonths()
focal_class.declarator: start
focal_class.modifier: private final
focal_class.original_string: private final DateTime start;
focal_class.type: DateTime
focal_class.var_name: start
focal_class.declarator: end
focal_class.modifier: private final
focal_class.original_string: private final DateTime end;
focal_class.type: DateTime
focal_class.var_name: end
focal_class.declarator: duration
focal_class.modifier: private final
focal_class.original_string: private final DateTimeDuration duration;
focal_class.type: DateTimeDuration
focal_class.var_name: duration
focal_class.declarator: key
focal_class.modifier: private final
focal_class.original_string: private final String key;
focal_class.type: String
focal_class.var_name: key
focal_class.declarator: longName
focal_class.modifier: private final
focal_class.original_string: private final String longName;
focal_class.type: String
focal_class.var_name: longName
focal_class.declarator: shortName
focal_class.modifier: private final
focal_class.original_string: private final String shortName;
focal_class.type: String
focal_class.var_name: shortName
focal_class.declarator: indexName
focal_class.modifier: private final
focal_class.original_string: private final String indexName;
focal_class.type: String
focal_class.var_name: indexName
focal_class.file: ch-commons-util/src/main/java/com/cloudhopper/commons/util/time/DateTimePeriod.java
focal_class.identifier: DateTimePeriod
focal_class.class_method_signature: DateTimePeriod.DateTimePeriod(DateTime start, DateTime end, DateTimeDuration duration, String keyPattern,
              String longNamePattern, String shortNamePattern, String indexNamePattern)
focal_class.full_signature: protected  DateTimePeriod(DateTime start, DateTime end, DateTimeDuration duration, String keyPattern,
              String longNamePattern, String shortNamePattern, String indexNamePattern)
focal_class.identifier: DateTimePeriod
focal_class.modifiers: protected
focal_class.parameters: (DateTime start, DateTime end, DateTimeDuration duration, String keyPattern,
              String longNamePattern, String shortNamePattern, String indexNamePattern)
focal_class.signature:  DateTimePeriod(DateTime start, DateTime end, DateTimeDuration duration, String keyPattern,
              String longNamePattern, String shortNamePattern, String indexNamePattern)
focal_class.class_method_signature: DateTimePeriod.getStart()
focal_class.full_signature: public DateTime getStart()
focal_class.identifier: getStart
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: DateTime
focal_class.signature: DateTime getStart()
focal_class.class_method_signature: DateTimePeriod.getEnd()
focal_class.full_signature: public DateTime getEnd()
focal_class.identifier: getEnd
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: DateTime
focal_class.signature: DateTime getEnd()
focal_class.class_method_signature: DateTimePeriod.getDuration()
focal_class.full_signature: public DateTimeDuration getDuration()
focal_class.identifier: getDuration
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: DateTimeDuration
focal_class.signature: DateTimeDuration getDuration()
focal_class.class_method_signature: DateTimePeriod.getKey()
focal_class.full_signature: public String getKey()
focal_class.identifier: getKey
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getKey()
focal_class.class_method_signature: DateTimePeriod.getLongName()
focal_class.full_signature: public String getLongName()
focal_class.identifier: getLongName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getLongName()
focal_class.class_method_signature: DateTimePeriod.getShortName()
focal_class.full_signature: public String getShortName()
focal_class.identifier: getShortName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getShortName()
focal_class.class_method_signature: DateTimePeriod.getIndexName()
focal_class.full_signature: public String getIndexName()
focal_class.identifier: getIndexName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getIndexName()
focal_class.class_method_signature: DateTimePeriod.getNext()
focal_class.full_signature: public abstract DateTimePeriod getNext()
focal_class.identifier: getNext
focal_class.modifiers: public abstract
focal_class.parameters: ()
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod getNext()
focal_class.class_method_signature: DateTimePeriod.getPrevious()
focal_class.full_signature: public abstract DateTimePeriod getPrevious()
focal_class.identifier: getPrevious
focal_class.modifiers: public abstract
focal_class.parameters: ()
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod getPrevious()
focal_class.class_method_signature: DateTimePeriod.getDefaultSubDuration()
focal_class.full_signature: public abstract DateTimeDuration getDefaultSubDuration()
focal_class.identifier: getDefaultSubDuration
focal_class.modifiers: public abstract
focal_class.parameters: ()
focal_class.return: DateTimeDuration
focal_class.signature: DateTimeDuration getDefaultSubDuration()
focal_class.class_method_signature: DateTimePeriod.toPeriods(DateTimeDuration duration)
focal_class.full_signature: public List<DateTimePeriod> toPeriods(DateTimeDuration duration)
focal_class.identifier: toPeriods
focal_class.modifiers: public
focal_class.parameters: (DateTimeDuration duration)
focal_class.return: List<DateTimePeriod>
focal_class.signature: List<DateTimePeriod> toPeriods(DateTimeDuration duration)
focal_class.class_method_signature: DateTimePeriod.toFiveMinutes()
focal_class.full_signature: public List<DateTimePeriod> toFiveMinutes()
focal_class.identifier: toFiveMinutes
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<DateTimePeriod>
focal_class.signature: List<DateTimePeriod> toFiveMinutes()
focal_class.class_method_signature: DateTimePeriod.toHours()
focal_class.full_signature: public List<DateTimePeriod> toHours()
focal_class.identifier: toHours
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<DateTimePeriod>
focal_class.signature: List<DateTimePeriod> toHours()
focal_class.class_method_signature: DateTimePeriod.toDays()
focal_class.full_signature: public List<DateTimePeriod> toDays()
focal_class.identifier: toDays
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<DateTimePeriod>
focal_class.signature: List<DateTimePeriod> toDays()
focal_class.class_method_signature: DateTimePeriod.toMonths()
focal_class.full_signature: public List<DateTimePeriod> toMonths()
focal_class.identifier: toMonths
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<DateTimePeriod>
focal_class.signature: List<DateTimePeriod> toMonths()
focal_class.class_method_signature: DateTimePeriod.toYears()
focal_class.full_signature: public List<DateTimePeriod> toYears()
focal_class.identifier: toYears
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<DateTimePeriod>
focal_class.signature: List<DateTimePeriod> toYears()
focal_class.class_method_signature: DateTimePeriod.equals(Object object)
focal_class.full_signature: @Override public boolean equals(Object object)
focal_class.identifier: equals
focal_class.modifiers: @Override public
focal_class.parameters: (Object object)
focal_class.return: boolean
focal_class.signature: boolean equals(Object object)
focal_class.class_method_signature: DateTimePeriod.hashCode()
focal_class.full_signature: @Override public int hashCode()
focal_class.identifier: hashCode
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int hashCode()
focal_class.class_method_signature: DateTimePeriod.create(DateTimeDuration duration, DateTime start)
focal_class.full_signature: static public DateTimePeriod create(DateTimeDuration duration, DateTime start)
focal_class.identifier: create
focal_class.modifiers: static public
focal_class.parameters: (DateTimeDuration duration, DateTime start)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod create(DateTimeDuration duration, DateTime start)
focal_class.class_method_signature: DateTimePeriod.createYear(int year, DateTimeZone zone)
focal_class.full_signature: static public DateTimePeriod createYear(int year, DateTimeZone zone)
focal_class.identifier: createYear
focal_class.modifiers: static public
focal_class.parameters: (int year, DateTimeZone zone)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod createYear(int year, DateTimeZone zone)
focal_class.class_method_signature: DateTimePeriod.createYear(DateTime start)
focal_class.full_signature: static public DateTimePeriod createYear(DateTime start)
focal_class.identifier: createYear
focal_class.modifiers: static public
focal_class.parameters: (DateTime start)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod createYear(DateTime start)
focal_class.class_method_signature: DateTimePeriod.createMonth(int year, int month, DateTimeZone zone)
focal_class.full_signature: static public DateTimePeriod createMonth(int year, int month, DateTimeZone zone)
focal_class.identifier: createMonth
focal_class.modifiers: static public
focal_class.parameters: (int year, int month, DateTimeZone zone)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod createMonth(int year, int month, DateTimeZone zone)
focal_class.class_method_signature: DateTimePeriod.createMonth(DateTime start)
focal_class.full_signature: static public DateTimePeriod createMonth(DateTime start)
focal_class.identifier: createMonth
focal_class.modifiers: static public
focal_class.parameters: (DateTime start)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod createMonth(DateTime start)
focal_class.class_method_signature: DateTimePeriod.createDay(int year, int month, int day, DateTimeZone zone)
focal_class.full_signature: static public DateTimePeriod createDay(int year, int month, int day, DateTimeZone zone)
focal_class.identifier: createDay
focal_class.modifiers: static public
focal_class.parameters: (int year, int month, int day, DateTimeZone zone)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod createDay(int year, int month, int day, DateTimeZone zone)
focal_class.class_method_signature: DateTimePeriod.createDay(DateTime start)
focal_class.full_signature: static public DateTimePeriod createDay(DateTime start)
focal_class.identifier: createDay
focal_class.modifiers: static public
focal_class.parameters: (DateTime start)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod createDay(DateTime start)
focal_class.class_method_signature: DateTimePeriod.createHour(int year, int month, int day, int hour, DateTimeZone zone)
focal_class.full_signature: static public DateTimePeriod createHour(int year, int month, int day, int hour, DateTimeZone zone)
focal_class.identifier: createHour
focal_class.modifiers: static public
focal_class.parameters: (int year, int month, int day, int hour, DateTimeZone zone)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod createHour(int year, int month, int day, int hour, DateTimeZone zone)
focal_class.class_method_signature: DateTimePeriod.createHour(DateTime start)
focal_class.full_signature: static public DateTimePeriod createHour(DateTime start)
focal_class.identifier: createHour
focal_class.modifiers: static public
focal_class.parameters: (DateTime start)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod createHour(DateTime start)
focal_class.class_method_signature: DateTimePeriod.createFiveMinutes(int year, int month, int day, int hour, int minute, DateTimeZone zone)
focal_class.full_signature: static public DateTimePeriod createFiveMinutes(int year, int month, int day, int hour, int minute, DateTimeZone zone)
focal_class.identifier: createFiveMinutes
focal_class.modifiers: static public
focal_class.parameters: (int year, int month, int day, int hour, int minute, DateTimeZone zone)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod createFiveMinutes(int year, int month, int day, int hour, int minute, DateTimeZone zone)
focal_class.class_method_signature: DateTimePeriod.createFiveMinutes(DateTime start)
focal_class.full_signature: static public DateTimePeriod createFiveMinutes(DateTime start)
focal_class.identifier: createFiveMinutes
focal_class.modifiers: static public
focal_class.parameters: (DateTime start)
focal_class.return: DateTimePeriod
focal_class.signature: DateTimePeriod createFiveMinutes(DateTime start)
focal_class.class_method_signature: DateTimePeriod.createLastYearMonths(DateTimeZone zone)
focal_class.full_signature: static public List<DateTimePeriod> createLastYearMonths(DateTimeZone zone)
focal_class.identifier: createLastYearMonths
focal_class.modifiers: static public
focal_class.parameters: (DateTimeZone zone)
focal_class.return: List<DateTimePeriod>
focal_class.signature: List<DateTimePeriod> createLastYearMonths(DateTimeZone zone)
focal_method.body: public List<DateTimePeriod> toMonths() {
          ArrayList<DateTimePeriod> list = new ArrayList<DateTimePeriod>();
  
          // default "current" month to start datetime
          DateTime currentStart = getStart();
          // calculate "next" month
          DateTime nextStart = currentStart.plusMonths(1);
          // continue adding until we've reached the end
          while (nextStart.isBefore(getEnd()) || nextStart.isEqual(getEnd())) {
              // its okay to add the current
              list.add(new DateTimeMonth(currentStart, nextStart));
              // increment both
              currentStart = nextStart;
              nextStart = currentStart.plusMonths(1);
          }
  
          return list;
      }
focal_method.class_method_signature: DateTimePeriod.toMonths()
focal_method.full_signature: public List<DateTimePeriod> toMonths()
focal_method.identifier: toMonths
focal_method.invocations: getStart plusMonths isBefore getEnd isEqual getEnd add plusMonths
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: List<DateTimePeriod>
focal_method.signature: List<DateTimePeriod> toMonths()