com.moneydance.apps.md.model.time
Interface Frequency

All Known Implementing Classes:
SimpleFrequency, TimeUnit

public interface Frequency

The Frequency interface is an abstraction for calculating recurring dates. Given a Frequency instance you can get the next or previous dates in the sequence.

Note: Because of the nature of months, frequencies based on the TimeUnit.MONTH may not always behave as expected. In particular, it cannot be guaranteed that calling next(MDDate) followed by previous(MDDate) will return you to the original date. Refer to the documentation of an implementor as to what behavior is expected.

Author:
Jay Detwiler

Method Summary
 java.lang.String getDescription()
          Returns a human readable description of the Frequency.
 MDDate next(MDDate date)
          Returns the next date in the sequency based on this frequency.
 MDDate previous(MDDate date)
          Returns the previous date in the sequency based on this frequency.
 

Method Detail

next

MDDate next(MDDate date)
Returns the next date in the sequency based on this frequency.

Parameters:
date - the initial MDDate
Returns:
the next date in the sequency based on this frequency.

previous

MDDate previous(MDDate date)
Returns the previous date in the sequency based on this frequency.

Parameters:
date - the initial MDDate
Returns:
the previous date in the sequency based on this frequency

getDescription

java.lang.String getDescription()
Returns a human readable description of the Frequency.

Returns:
a human readable description of the Frequency.