com.moneydance.apps.md.model.time
Class TimeUnit

java.lang.Object
  extended by com.moneydance.apps.md.model.time.TimeUnit
All Implemented Interfaces:
Frequency, Stringifyable

public final class TimeUnit
extends java.lang.Object
implements Frequency, Stringifyable

The MDTimeUnit class is the Moneydance representation of a base time unit.

This class is immutable.

Author:
Jay Detwiler

Field Summary
protected  int calendarField
           
static TimeUnit DAY
           
static TimeUnit MONTH
           
protected  int numUnits
           
static TimeUnit QUARTER
           
static TimeUnit[] STANDARD_UNITS
           
static TimeUnit WEEK
           
static TimeUnit YEAR
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
static TimeUnit fromString(java.lang.String string)
           
 java.lang.String getDescription()
          Returns a human readable description of the Frequency.
 java.lang.String getPluralName()
           
 java.lang.String getSingularName()
           
 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
 

Field Detail

calendarField

protected int calendarField

numUnits

protected int numUnits

DAY

public static final TimeUnit DAY

WEEK

public static final TimeUnit WEEK

MONTH

public static final TimeUnit MONTH

QUARTER

public static final TimeUnit QUARTER

YEAR

public static final TimeUnit YEAR

STANDARD_UNITS

public static final TimeUnit[] STANDARD_UNITS
Method Detail

getSingularName

public java.lang.String getSingularName()

getPluralName

public java.lang.String getPluralName()

next

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

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

previous

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

Specified by:
previous in interface Frequency
Parameters:
date - the initial MDDate
Returns:
the previous date in the sequency based on this frequency

getDescription

public java.lang.String getDescription()
Description copied from interface: Frequency
Returns a human readable description of the Frequency.

Specified by:
getDescription in interface Frequency
Returns:
a human readable description of the Frequency.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

fromString

public static TimeUnit fromString(java.lang.String string)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object