com.moneydance.apps.md.model.time
Enum DateRangeOption

java.lang.Object
  extended by java.lang.Enum<DateRangeOption>
      extended by com.moneydance.apps.md.model.time.DateRangeOption
All Implemented Interfaces:
DisplayableObject, java.io.Serializable, java.lang.Comparable<DateRangeOption>

public enum DateRangeOption
extends java.lang.Enum<DateRangeOption>
implements DisplayableObject

Defines the various date ranges that can be selected in reports, budgets, etc. The ordinal values are fixed to the original integers (indices) mapped to a date range, as previously defined in DateRangeChooser:

     DR_YEAR_TO_DATE = 0
     DR_QUARTER_TO_DATE = 1
     DR_MONTH_TO_DATE = 2
     DR_THIS_YEAR = 3
     DR_THIS_QUARTER = 4
     DR_THIS_MONTH = 5
     DR_LAST_YEAR = 6
     DR_LAST_QUARTER = 7
     DR_LAST_MONTH = 8
     DR_LAST_12_MONTHS = 9
     DR_ALL_DATES = 10
     DR_CUSTOM_DATE = 11
New, additional date ranges were requested for the budget system, so these are tacked on to the end of the list. Because they are out-of-order for logical display purposes in a list, a sorting index is assigned so that the list of date ranges may be more logically presented to the user.
     DR_LAST_30_DAYS = 12
     DR_LAST_365_DAYS = 13
     DR_THIS_WEEK = 14
     DR_LAST_WEEK = 15
 An additional request was for investment performance reports for the last day (seeing how
 market changes in one day affected results)
     DR_LAST_DAY = 16
 

Author:
Kevin Menningen - Mennē Software Solutions, LLC

Enum Constant Summary
DR_ALL_DATES
          All dates to today's date.
DR_CUSTOM_DATE
          User-defined date range.
DR_LAST_1_DAY
          Previous day to today.
DR_LAST_12_MONTHS
          Last 12 months from today's date, starting at 12 months prior to today until today's date.
DR_LAST_30_DAYS
          Last 30 days from today's date.
DR_LAST_365_DAYS
          Last 365 days from today's date.
DR_LAST_MONTH
          Previous month from beginning to end.
DR_LAST_QUARTER
          Previous quarter from beginning to end.
DR_LAST_WEEK
          Previous week from beginning to end.
DR_LAST_YEAR
          Previous year from beginning to end.
DR_MONTH_TO_DATE
          Current month to today's date.
DR_QUARTER_TO_DATE
          Current quarter to today's date.
DR_THIS_MONTH
          Current month from beginning to end.
DR_THIS_QUARTER
          Current quarter from beginning to end.
DR_THIS_WEEK
          Current week from beginning to end.
DR_THIS_YEAR
          Current year from beginning to end.
DR_YEAR_TO_DATE
          Current year to today's date.
 
Field Summary
static java.lang.String CONFIG_KEY
          Key used to store and retrieve a date range from settings, parameters, URLs, etc.
static DateRangeOption DEFAULT
          The default date range to use if none is specified.
 
Method Summary
static DateRangeOption fromInt(int value)
          Given an integer value, return the matching date range.
static DateRangeOption fromKey(java.lang.String key)
          Given a string key, return the matching date range.
 int getHotKey()
           
 java.lang.String getResourceKey()
          Return a resource key for a localized string describing this object.
 int getSortKey()
           
static DateRangeOption valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static DateRangeOption[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DR_YEAR_TO_DATE

public static final DateRangeOption DR_YEAR_TO_DATE
Current year to today's date.


DR_QUARTER_TO_DATE

public static final DateRangeOption DR_QUARTER_TO_DATE
Current quarter to today's date.


DR_MONTH_TO_DATE

public static final DateRangeOption DR_MONTH_TO_DATE
Current month to today's date.


DR_THIS_YEAR

public static final DateRangeOption DR_THIS_YEAR
Current year from beginning to end.


DR_THIS_QUARTER

public static final DateRangeOption DR_THIS_QUARTER
Current quarter from beginning to end.


DR_THIS_MONTH

public static final DateRangeOption DR_THIS_MONTH
Current month from beginning to end.


DR_LAST_YEAR

public static final DateRangeOption DR_LAST_YEAR
Previous year from beginning to end.


DR_LAST_QUARTER

public static final DateRangeOption DR_LAST_QUARTER
Previous quarter from beginning to end.


DR_LAST_MONTH

public static final DateRangeOption DR_LAST_MONTH
Previous month from beginning to end.


DR_LAST_12_MONTHS

public static final DateRangeOption DR_LAST_12_MONTHS
Last 12 months from today's date, starting at 12 months prior to today until today's date.


DR_ALL_DATES

public static final DateRangeOption DR_ALL_DATES
All dates to today's date.


DR_CUSTOM_DATE

public static final DateRangeOption DR_CUSTOM_DATE
User-defined date range.


DR_THIS_WEEK

public static final DateRangeOption DR_THIS_WEEK
Current week from beginning to end.


DR_LAST_30_DAYS

public static final DateRangeOption DR_LAST_30_DAYS
Last 30 days from today's date.


DR_LAST_365_DAYS

public static final DateRangeOption DR_LAST_365_DAYS
Last 365 days from today's date.


DR_LAST_WEEK

public static final DateRangeOption DR_LAST_WEEK
Previous week from beginning to end.


DR_LAST_1_DAY

public static final DateRangeOption DR_LAST_1_DAY
Previous day to today.

Field Detail

CONFIG_KEY

public static final java.lang.String CONFIG_KEY
Key used to store and retrieve a date range from settings, parameters, URLs, etc.

See Also:
Constant Field Values

DEFAULT

public static final DateRangeOption DEFAULT
The default date range to use if none is specified.

Method Detail

values

public static final DateRangeOption[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(DateRangeOption c : DateRangeOption.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static DateRangeOption valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getResourceKey

public java.lang.String getResourceKey()
Description copied from interface: DisplayableObject
Return a resource key for a localized string describing this object.

Specified by:
getResourceKey in interface DisplayableObject
Returns:
The unique string key for obtaining a localized display string and as a unique identifier.

getHotKey

public int getHotKey()
Returns:
The hot key identifier that corresponds to the option.

getSortKey

public int getSortKey()
Returns:
The sorting index to use for sorting the list of date ranges for display.

fromInt

public static DateRangeOption fromInt(int value)
Given an integer value, return the matching date range. If not found, DEFAULT is returned.

Parameters:
value - The integer value to convert.
Returns:
The corresponding date range.

fromKey

public static DateRangeOption fromKey(java.lang.String key)
Given a string key, return the matching date range. If not found, DEFAULT is returned.

Parameters:
key - The string key value to convert.
Returns:
The corresponding balance type.