|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.moneydance.apps.md.model.time.SimpleFrequency
public class SimpleFrequency
The SimpleFrequency
class is an implementation of Frequency
that uses a multiple of a given
TimeUnit
to calculate next and previous dates.
month
,quarter
or year
time units, you may not get the intended results. Moving forward a month means moving the month portion of the
date forward while leaving the date the same. Since the result won't always be a valid date, the date will be
resolved in the same manner as GregorianCalendar.add(int, int)
.
This class is immutable.
Constructor Summary | |
---|---|
SimpleFrequency(TimeUnit unit)
Creates a SimpleFrequency based on a single TimeUnit |
|
SimpleFrequency(TimeUnit unit,
int num)
Creates a SimpleFrequency based on a multiple of a TimeUnit |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
static SimpleFrequency |
fromString(java.lang.String string)
|
java.lang.String |
getDescription()
Returns a human readable description of the Frequency . |
int |
getNumberOfUnits()
|
TimeUnit |
getUnit()
|
int |
hashCode()
|
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. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleFrequency(TimeUnit unit)
SimpleFrequency
based on a single TimeUnit
unit
- a TimeUnitpublic SimpleFrequency(TimeUnit unit, int num)
SimpleFrequency
based on a multiple of a TimeUnit
unit
- a TimeUnitnum
- a positive numberMethod Detail |
---|
public MDDate next(MDDate date)
next
in interface Frequency
date
- the initial MDDate
public MDDate previous(MDDate date)
previous
in interface Frequency
date
- the initial MDDate
public java.lang.String toString()
toString
in class java.lang.Object
public static SimpleFrequency fromString(java.lang.String string)
public TimeUnit getUnit()
public int getNumberOfUnits()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getDescription()
Frequency
Frequency
.
getDescription
in interface Frequency
Frequency
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |