code: private BigInteger getDaysOfTheWeek(RecurringData data)
     {
        int value = 0;
        for (Day day : Day.values())
        {
           if (data.getWeeklyDay(day))
           {
              value = value | DAY_MASKS[day.getValue()];
           }
        }
        return BigInteger.valueOf(value);
     }
docs: Converts days of the week into a bit field.
  
  @param data recurring data
  @return bit field