public void setPeriod(String period) {
        if (period.equals(WEEKLY)) {
            field = Calendar.DAY_OF_WEEK;
        } else if (period.equals(MONTHLY)) {
            field = Calendar.DAY_OF_MONTH;
        } else if (period.equals(YEARLY)) {
            field = Calendar.DAY_OF_YEAR;
        } else {
            throw new IllegalArgumentException(period);
        }
    }