Logo Search packages:      
Sourcecode: pcalendar version File versions  Download package

PCalDayInfo net::sf::linuxorg::pcal::engine::Engine::getOvulationDayInfo ( final Date  date ) [inline, private]

Get the day info record for the recorded ovulation date

Parameters:
date- the record date
Returns:
the day information record

Definition at line 410 of file Engine.java.

References dateDiff(), dateTypes, net::sf::linuxorg::pcal::PCalDayInfo::day_num, net::sf::linuxorg::pcal::engine::DayInfoRecordsFactory::getFertileDayInfo(), and getPeriodStartDate().

Referenced by getDayInfo().

                                                               {
            final int MIN_CYCLE_DAYS_AFTER_OVULATION = 14;

            PCalDayInfo info = DayInfoRecordsFactory.getFertileDayInfo(-1);

            // calculating the period day number is the only non-trivial step here
            Date period_start_date = getPeriodStartDate(date, true);
            if(dateTypes.get(period_start_date) == PCAL_TYPE_MENS) {
                  info.day_num = dateDiff(date, period_start_date);

                  // the ovulation can no be at the very end of the cycle
                  if(info.day_num > (enginePreferences.regularMaxLength - MIN_CYCLE_DAYS_AFTER_OVULATION)) {
                        // we are out of the regular period, don't know the period day #
                        info.day_num = -1;
                  }
            }
            return info;
      }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index