public TimeRegulate takeTimeRegulate()
{
if (this.month == null || (this.day == null && this.week == null) || this.hour == null || this.minute == null)
return null;
TimeRegulate timeRegulate = new TimeRegulate();
timeRegulate.getMonthSet().clear();
String[] month = this.getMonth().split(",");
for (int i = 0; i < month.length && month[i] != null && month[i].trim().length() != 0; i++)
timeRegulate.getMonthSet().add(Integer.parseInt(month[i]));
if (timeRegulate.getMonthSet().isEmpty())
return null;
timeRegulate.getDateSet().clear();
String[] date = this.getDay().split(",");
for (int i = 0; i < date.length && date[i] != null && date[i].trim().length() != 0; i++)
timeRegulate.getDateSet().add(Integer.parseInt(date[i]));
if (timeRegulate.getDateSet().isEmpty())
return null;
timeRegulate.getDaySet().clear();
String[] week = this.getWeek().split(",");
for (int i = 0; i < week.length && week[i] != null && week[i].trim().length() != 0; i++)
timeRegulate.getDaySet().add(Integer.parseInt(week[i]));
if (timeRegulate.getDaySet().isEmpty())
return null;
timeRegulate.getHourSet().clear();
String[] hour = this.getHour().split(",");
for (int i = 0; i < hour.length && hour[i] != null && hour[i].trim().length() != 0; i++)
timeRegulate.getHourSet().add(Integer.parseInt(hour[i]));
if (timeRegulate.getHourSet().isEmpty())
return null;
timeRegulate.getMinuteSet().clear();
String[] minute = this.getMinute().split(",");
for (int i = 0; i < minute.length && minute[i] != null && minute[i].trim().length() != 0; i++)
timeRegulate.getMinuteSet().add(Integer.parseInt(minute[i]));
if (timeRegulate.getMinuteSet().isEmpty())
return null;
timeRegulate.getSecondSet().clear();
timeRegulate.getSecondSet().add(0);
return timeRegulate;
}