test_class.file: dddlib-utils/src/test/java/org/dayatang/utils/DateUtilsTest.java
test_class.identifier: DateUtilsTest
test_case.body: @Test
  	public void getDayDiff() {
  		assertEquals(31, DateUtils.getDayDiff(DateUtils.parseDate("2009-1-1"), DateUtils.parseDate("2009-2-1")));
  		assertEquals(2, DateUtils.getDayDiff(DateUtils.parseDate("2009-1-31"), DateUtils.parseDate("2009-2-2")));
  	}
test_case.class_method_signature: DateUtilsTest.getDayDiff()
test_case.full_signature: @Test public void getDayDiff()
test_case.identifier: getDayDiff
test_case.invocations: assertEquals getDayDiff parseDate parseDate assertEquals getDayDiff parseDate parseDate
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void getDayDiff()
focal_class.declarator: MIN_DATE = date(1000, 1, 1)
focal_class.modifier: public static final
focal_class.original_string: public static final Date MIN_DATE = date(1000, 1, 1);
focal_class.type: Date
focal_class.var_name: MIN_DATE
focal_class.declarator: MAX_DATE = date(8888, 1, 1)
focal_class.modifier: public static final
focal_class.original_string: public static final Date MAX_DATE = date(8888, 1, 1);
focal_class.type: Date
focal_class.var_name: MAX_DATE
focal_class.declarator: MILLIS_IN_A_SECOND = 1000
focal_class.modifier: private static final
focal_class.original_string: private static final long MILLIS_IN_A_SECOND = 1000;
focal_class.type: long
focal_class.var_name: MILLIS_IN_A_SECOND
focal_class.declarator: SECONDS_IN_A_MINUTE = 60
focal_class.modifier: private static final
focal_class.original_string: private static final long SECONDS_IN_A_MINUTE = 60;
focal_class.type: long
focal_class.var_name: SECONDS_IN_A_MINUTE
focal_class.declarator: MINUTES_IN_AN_HOUR = 60
focal_class.modifier: private static final
focal_class.original_string: private static final long MINUTES_IN_AN_HOUR = 60;
focal_class.type: long
focal_class.var_name: MINUTES_IN_AN_HOUR
focal_class.declarator: HOURS_IN_A_DAY = 24
focal_class.modifier: private static final
focal_class.original_string: private static final long HOURS_IN_A_DAY = 24;
focal_class.type: long
focal_class.var_name: HOURS_IN_A_DAY
focal_class.declarator: DAYS_IN_A_WEEK = 7
focal_class.modifier: private static final
focal_class.original_string: private static final int DAYS_IN_A_WEEK = 7;
focal_class.type: int
focal_class.var_name: DAYS_IN_A_WEEK
focal_class.declarator: MONTHS_IN_A_YEAR = 12
focal_class.modifier: private static final
focal_class.original_string: private static final int MONTHS_IN_A_YEAR = 12;
focal_class.type: int
focal_class.var_name: MONTHS_IN_A_YEAR
focal_class.file: dddlib-utils/src/main/java/org/dayatang/utils/DateUtils.java
focal_class.identifier: DateUtils
focal_class.class_method_signature: DateUtils.DateUtils()
focal_class.full_signature: private  DateUtils()
focal_class.identifier: DateUtils
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  DateUtils()
focal_class.class_method_signature: DateUtils.date(int year, int month, int day)
focal_class.full_signature: public static Date date(int year, int month, int day)
focal_class.identifier: date
focal_class.modifiers: public static
focal_class.parameters: (int year, int month, int day)
focal_class.return: Date
focal_class.signature: Date date(int year, int month, int day)
focal_class.class_method_signature: DateUtils.date(int year, int month, int day,
              int hour, int minute, int second)
focal_class.full_signature: public static Date date(int year, int month, int day,
              int hour, int minute, int second)
focal_class.identifier: date
focal_class.modifiers: public static
focal_class.parameters: (int year, int month, int day,
              int hour, int minute, int second)
focal_class.return: Date
focal_class.signature: Date date(int year, int month, int day,
              int hour, int minute, int second)
focal_class.class_method_signature: DateUtils.getYearDiff(Date date1, Date date2)
focal_class.full_signature: public static int getYearDiff(Date date1, Date date2)
focal_class.identifier: getYearDiff
focal_class.modifiers: public static
focal_class.parameters: (Date date1, Date date2)
focal_class.return: int
focal_class.signature: int getYearDiff(Date date1, Date date2)
focal_class.class_method_signature: DateUtils.getMonthDiff(Date date1, Date date2)
focal_class.full_signature: public static int getMonthDiff(Date date1, Date date2)
focal_class.identifier: getMonthDiff
focal_class.modifiers: public static
focal_class.parameters: (Date date1, Date date2)
focal_class.return: int
focal_class.signature: int getMonthDiff(Date date1, Date date2)
focal_class.class_method_signature: DateUtils.getDayDiff(Date date1, Date date2)
focal_class.full_signature: public static int getDayDiff(Date date1, Date date2)
focal_class.identifier: getDayDiff
focal_class.modifiers: public static
focal_class.parameters: (Date date1, Date date2)
focal_class.return: int
focal_class.signature: int getDayDiff(Date date1, Date date2)
focal_class.class_method_signature: DateUtils.getMinuteDiffByTime(Date time1, Date time2)
focal_class.full_signature: public static int getMinuteDiffByTime(Date time1, Date time2)
focal_class.identifier: getMinuteDiffByTime
focal_class.modifiers: public static
focal_class.parameters: (Date time1, Date time2)
focal_class.return: int
focal_class.signature: int getMinuteDiffByTime(Date time1, Date time2)
focal_class.class_method_signature: DateUtils.getPrevDay(Date date)
focal_class.full_signature: public static Date getPrevDay(Date date)
focal_class.identifier: getPrevDay
focal_class.modifiers: public static
focal_class.parameters: (Date date)
focal_class.return: Date
focal_class.signature: Date getPrevDay(Date date)
focal_class.class_method_signature: DateUtils.getNextDay(Date date)
focal_class.full_signature: public static Date getNextDay(Date date)
focal_class.identifier: getNextDay
focal_class.modifiers: public static
focal_class.parameters: (Date date)
focal_class.return: Date
focal_class.signature: Date getNextDay(Date date)
focal_class.class_method_signature: DateUtils.isDateAfter(Date date1, Date date2)
focal_class.full_signature: public static boolean isDateAfter(Date date1, Date date2)
focal_class.identifier: isDateAfter
focal_class.modifiers: public static
focal_class.parameters: (Date date1, Date date2)
focal_class.return: boolean
focal_class.signature: boolean isDateAfter(Date date1, Date date2)
focal_class.class_method_signature: DateUtils.isDateBefore(Date date1, Date date2)
focal_class.full_signature: public static boolean isDateBefore(Date date1, Date date2)
focal_class.identifier: isDateBefore
focal_class.modifiers: public static
focal_class.parameters: (Date date1, Date date2)
focal_class.return: boolean
focal_class.signature: boolean isDateBefore(Date date1, Date date2)
focal_class.class_method_signature: DateUtils.isTimeAfter(Date time1, Date time2)
focal_class.full_signature: public static boolean isTimeAfter(Date time1, Date time2)
focal_class.identifier: isTimeAfter
focal_class.modifiers: public static
focal_class.parameters: (Date time1, Date time2)
focal_class.return: boolean
focal_class.signature: boolean isTimeAfter(Date time1, Date time2)
focal_class.class_method_signature: DateUtils.isTimeBefore(Date time1, Date time2)
focal_class.full_signature: public static boolean isTimeBefore(Date time1, Date time2)
focal_class.identifier: isTimeBefore
focal_class.modifiers: public static
focal_class.parameters: (Date time1, Date time2)
focal_class.return: boolean
focal_class.signature: boolean isTimeBefore(Date time1, Date time2)
focal_class.class_method_signature: DateUtils.isSameDay(Date date1, Date date2)
focal_class.full_signature: public static boolean isSameDay(Date date1, Date date2)
focal_class.identifier: isSameDay
focal_class.modifiers: public static
focal_class.parameters: (Date date1, Date date2)
focal_class.return: boolean
focal_class.signature: boolean isSameDay(Date date1, Date date2)
focal_class.class_method_signature: DateUtils.isSameDay(Calendar date1, Calendar date2)
focal_class.full_signature: public static boolean isSameDay(Calendar date1, Calendar date2)
focal_class.identifier: isSameDay
focal_class.modifiers: public static
focal_class.parameters: (Calendar date1, Calendar date2)
focal_class.return: boolean
focal_class.signature: boolean isSameDay(Calendar date1, Calendar date2)
focal_class.class_method_signature: DateUtils.parseDate(String dateString)
focal_class.full_signature: public static Date parseDate(String dateString)
focal_class.identifier: parseDate
focal_class.modifiers: public static
focal_class.parameters: (String dateString)
focal_class.return: Date
focal_class.signature: Date parseDate(String dateString)
focal_class.class_method_signature: DateUtils.parseTime(String timeString)
focal_class.full_signature: public static Date parseTime(String timeString)
focal_class.identifier: parseTime
focal_class.modifiers: public static
focal_class.parameters: (String timeString)
focal_class.return: Date
focal_class.signature: Date parseTime(String timeString)
focal_class.class_method_signature: DateUtils.parseDateTime(String timeString)
focal_class.full_signature: public static Date parseDateTime(String timeString)
focal_class.identifier: parseDateTime
focal_class.modifiers: public static
focal_class.parameters: (String timeString)
focal_class.return: Date
focal_class.signature: Date parseDateTime(String timeString)
focal_class.class_method_signature: DateUtils.getWeekDaysBetween(Date fromDate, Date toDate,
              int dayOfWeek)
focal_class.full_signature: public static int getWeekDaysBetween(Date fromDate, Date toDate,
              int dayOfWeek)
focal_class.identifier: getWeekDaysBetween
focal_class.modifiers: public static
focal_class.parameters: (Date fromDate, Date toDate,
              int dayOfWeek)
focal_class.return: int
focal_class.signature: int getWeekDaysBetween(Date fromDate, Date toDate,
              int dayOfWeek)
focal_class.class_method_signature: DateUtils.getFirstWeekdayBetween(Date fromDate, Date toDate,
              int dayOfWeek)
focal_class.full_signature: public static Date getFirstWeekdayBetween(Date fromDate, Date toDate,
              int dayOfWeek)
focal_class.identifier: getFirstWeekdayBetween
focal_class.modifiers: public static
focal_class.parameters: (Date fromDate, Date toDate,
              int dayOfWeek)
focal_class.return: Date
focal_class.signature: Date getFirstWeekdayBetween(Date fromDate, Date toDate,
              int dayOfWeek)
focal_class.class_method_signature: DateUtils.getDaysInYear(int year)
focal_class.full_signature: public static int getDaysInYear(int year)
focal_class.identifier: getDaysInYear
focal_class.modifiers: public static
focal_class.parameters: (int year)
focal_class.return: int
focal_class.signature: int getDaysInYear(int year)
focal_class.class_method_signature: DateUtils.getDaysInMonth(int year, int month)
focal_class.full_signature: public static int getDaysInMonth(int year, int month)
focal_class.identifier: getDaysInMonth
focal_class.modifiers: public static
focal_class.parameters: (int year, int month)
focal_class.return: int
focal_class.signature: int getDaysInMonth(int year, int month)
focal_class.class_method_signature: DateUtils.getYear(Date date)
focal_class.full_signature: public static int getYear(Date date)
focal_class.identifier: getYear
focal_class.modifiers: public static
focal_class.parameters: (Date date)
focal_class.return: int
focal_class.signature: int getYear(Date date)
focal_class.class_method_signature: DateUtils.getMonth(Date date)
focal_class.full_signature: public static int getMonth(Date date)
focal_class.identifier: getMonth
focal_class.modifiers: public static
focal_class.parameters: (Date date)
focal_class.return: int
focal_class.signature: int getMonth(Date date)
focal_class.class_method_signature: DateUtils.getDayOfYear(Date date)
focal_class.full_signature: public static int getDayOfYear(Date date)
focal_class.identifier: getDayOfYear
focal_class.modifiers: public static
focal_class.parameters: (Date date)
focal_class.return: int
focal_class.signature: int getDayOfYear(Date date)
focal_class.class_method_signature: DateUtils.getDayOfMonth(Date date)
focal_class.full_signature: public static int getDayOfMonth(Date date)
focal_class.identifier: getDayOfMonth
focal_class.modifiers: public static
focal_class.parameters: (Date date)
focal_class.return: int
focal_class.signature: int getDayOfMonth(Date date)
focal_class.class_method_signature: DateUtils.getDayOfWeek(Date date)
focal_class.full_signature: public static int getDayOfWeek(Date date)
focal_class.identifier: getDayOfWeek
focal_class.modifiers: public static
focal_class.parameters: (Date date)
focal_class.return: int
focal_class.signature: int getDayOfWeek(Date date)
focal_class.class_method_signature: DateUtils.getFieldValue(Date date, int field)
focal_class.full_signature: private static int getFieldValue(Date date, int field)
focal_class.identifier: getFieldValue
focal_class.modifiers: private static
focal_class.parameters: (Date date, int field)
focal_class.return: int
focal_class.signature: int getFieldValue(Date date, int field)
focal_class.class_method_signature: DateUtils.dateAfter(Date origDate, int amount, int timeUnit)
focal_class.full_signature: public static final Date dateAfter(Date origDate, int amount, int timeUnit)
focal_class.identifier: dateAfter
focal_class.modifiers: public static final
focal_class.parameters: (Date origDate, int amount, int timeUnit)
focal_class.return: Date
focal_class.signature: Date dateAfter(Date origDate, int amount, int timeUnit)
focal_class.class_method_signature: DateUtils.dateBefore(Date origDate, int amount, int timeUnit)
focal_class.full_signature: public static final Date dateBefore(Date origDate, int amount, int timeUnit)
focal_class.identifier: dateBefore
focal_class.modifiers: public static final
focal_class.parameters: (Date origDate, int amount, int timeUnit)
focal_class.return: Date
focal_class.signature: Date dateBefore(Date origDate, int amount, int timeUnit)
focal_method.body: public static int getDayDiff(Date date1, Date date2) {
          if (date1 == null || date2 == null) {
              throw new InvalidParameterException(
                      "date1 and date2 cannot be null!");
          }
          Date startDate = org.apache.commons.lang3.time.DateUtils.truncate(
                  date1, Calendar.DATE);
          Date endDate = org.apache.commons.lang3.time.DateUtils.truncate(date2,
                  Calendar.DATE);
          if (startDate.after(endDate)) {
              throw new InvalidParameterException("date1 cannot be after date2!");
          }
          long millSecondsInOneDay = HOURS_IN_A_DAY * MINUTES_IN_AN_HOUR
                  * SECONDS_IN_A_MINUTE * MILLIS_IN_A_SECOND;
          return (int) ((endDate.getTime() - startDate.getTime()) / millSecondsInOneDay);
      }
focal_method.class_method_signature: DateUtils.getDayDiff(Date date1, Date date2)
focal_method.full_signature: public static int getDayDiff(Date date1, Date date2)
focal_method.identifier: getDayDiff
focal_method.invocations: truncate truncate after getTime getTime
focal_method.modifiers: public static
focal_method.parameters: (Date date1, Date date2)
focal_method.return: int
focal_method.signature: int getDayDiff(Date date1, Date date2)