com.sap.netweaver.bc.uwl

Class DateFilterEnum

java.lang.Object
  extended bycom.sap.netweaver.bc.uwl.DateFilterEnum
All Implemented Interfaces:
Serializable

public final class DateFilterEnum
extends Object
implements Serializable

The DateFilterEnum class could be used for filtering on date attributes relatively. For example, filter expression for the due dates in next 3 months could be expressed in either of the following ways: <Condition name="dueDate" comparator="equals" value="Next_3_Months"> or <Condition name="dueDate" comparator="lessThan" value="Next_3_Months"> The value part should match the constants defined in this file.
All possible fixed "value" are


For date comparision several comparators mean the same thing.
For any comparision, first appropriate range is calculated. For example if "value" is Next_3_Months, and today is Sept 15, a range of Sept 15 morning 00:00 hrs to Dec 31 midnight is calculated. And comparision is applied for "name" and "value". "value" can also be a fixed date. If it is a fixed date string, it has to be one the formats.
<Condition name="dueDate" comparator="equals" value="2003.12.25"> or
<Condition name="dueDate" comparator="lessThan" value="2004.12.31 10:00:00 pm">

See Also:
ComparatorEnum, SimpleDateFormat, Serialized Form

Field Summary
static String FORMAT_DB
          Format understandable by OpenSql Database yyyy-MM-dd HH:mm:ss
static String FORMAT_LONG_EU
          yyyy.MM.dd hh:mm:ss a format for European type of date representation eg. 2004.12.31 16:40:12 It is necessary to specify the time part completely in this format.
static String FORMAT_LONG_US
          yyyy.MM.dd hh:mm:ss a format for US type of date representation eg.2004.12.31 10:00:00 pm It is necessary to specify the time part completely in this format.
static String FORMAT_R3
          Format understandable by R3.
static String FORMAT_SHORT
          yyyy.MM.dd format eg: 2004.12.31
static int I_LAST_3_MONTHS
          This indicates the previous three months in reference to "today".
static int I_LAST_30_DAYS
          This indicates rolling last 30 or 31 days.
static int I_LAST_365_DAYS
          This indicates rolling last 365 or 366 days.
static int I_LAST_7_DAYS
          This indicates rolling last 7 days.
static int I_LAST_90_DAYS
          This indicates rolling last 90/91/92 days.
static int I_LAST_MONTH
          This indicates the previous month in reference to "today".
static int I_LAST_WEEK
          This indicates the previous week in reference to "this week".
static int I_LAST_YEAR
          This indicates the last year in reference to "this year".
static int I_NEXT_3_MONTHS
          This indicates the next three months in reference to "today".
static int I_NEXT_30_DAYS
          This indicates rolling next 30 or 31 days.
static int I_NEXT_365_DAYS
          This indicates rolling last 365 or 366 days.
static int I_NEXT_7_DAYS
          This indicates rolling next 7 days.
static int I_NEXT_90_DAYS
          This indicates rolling next 90/91/92 days.
static int I_NEXT_MONTH
          This indicates the next month in reference to "today".
static int I_NEXT_WEEK
          This indicates the next week in reference to "this week".
static int I_NEXT_YEAR
          This indicates the next year in reference to "this year".
static int I_THIS_MONTH
          This indicates the current month that contains "today".
static int I_THIS_WEEK
          This indicates the current week that contains "today".
static int I_THIS_YEAR
          This indicates this year that contains "today".
static int I_TODAY
          This indicates "today".
static int I_TOMORROW
          This indicates Tomorrow
static int I_UNDEFINED
          This indicates the undefined date filter which is equal to "today" (as of November 12, 2003).
static int I_YESTERDAY
          This indicates Yesterday
static DateFilterEnum LAST_3_MONTHS
          This indicates the previous three months in reference to "today".
static DateFilterEnum LAST_30_DAYS
          This indicates "Last_30_Days".Doesnt include today.
static DateFilterEnum LAST_365_DAYS
          This indicates "Last_365_Days".
static DateFilterEnum LAST_7_DAYS
          This indicates "Last_7_Days".
static DateFilterEnum LAST_90_DAYS
          This indicates "Last_90_Days".
static DateFilterEnum LAST_MONTH
          This indicates the previous month in reference to "today".
static DateFilterEnum LAST_WEEK
          This indicates the previous week in reference to "this week".
static DateFilterEnum LAST_YEAR
          This indicates the last year in reference to "this year".
static DateFilterEnum NEXT_3_MONTHS
          This indicates the next three months in reference to "today".
static DateFilterEnum NEXT_30_DAYS
          This indicates "Next_30_Days".Doesnt include today.
static DateFilterEnum NEXT_365_DAYS
          This indicates "Next_365_Days".
static DateFilterEnum NEXT_7_DAYS
          This indicates "Next_7_Days".
static DateFilterEnum NEXT_90_DAYS
          This indicates "Next_90_Days".
static DateFilterEnum NEXT_MONTH
          This indicates the next month in reference to "today".
static DateFilterEnum NEXT_WEEK
          This indicates the next week in reference to "this week".
static DateFilterEnum NEXT_YEAR
          This indicates the next year in reference to "this year".
protected static String RESOURCE_PREFIX
           
static DateFilterEnum THIS_MONTH
          This indicates the current month that contains "today".
static DateFilterEnum THIS_WEEK
          This indicates the current week that contains "today".
static DateFilterEnum THIS_YEAR
          This indicates this year that contains "today".
static DateFilterEnum TODAY
          This indicates "today".
static DateFilterEnum TOMORROW
          This indicates "Tomorrow".
static DateFilterEnum UNDEFINED
          This indicates the undefined date filter which is equal to "today" (as of November 12, 2003).
static TimeZone UTC
          Represents the UTC Timezone instance.
static DateFilterEnum YESTERDAY
          This indicates "Yesterday".
 
Method Summary
 boolean equals(Object obj)
           
static DateFilterEnum getEnumFromKey(String key)
           
static Iterator getIterator()
           
 String getText()
          Returns the readable text like "Today","LastWeek" etc.
 String getText(Locale locale)
          Return the Display text for this enum type.
 int getType()
           
static SimpleDateFormat getUtcFormatter(String format, Locale loc)
          returns UTC timezone formatter to be used for formatting the strings.
 String getValue()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE_PREFIX

protected static final String RESOURCE_PREFIX
See Also:
Constant Field Values

UTC

public static final TimeZone UTC
Represents the UTC Timezone instance.


FORMAT_SHORT

public static final String FORMAT_SHORT
yyyy.MM.dd format eg: 2004.12.31

See Also:
Constant Field Values

FORMAT_LONG_US

public static final String FORMAT_LONG_US
yyyy.MM.dd hh:mm:ss a format for US type of date representation eg.2004.12.31 10:00:00 pm It is necessary to specify the time part completely in this format. There for 2004.12.31 10:12 which doesnt have seconds part is not an accepted value.

See Also:
Constant Field Values

FORMAT_LONG_EU

public static final String FORMAT_LONG_EU
yyyy.MM.dd hh:mm:ss a format for European type of date representation eg. 2004.12.31 16:40:12 It is necessary to specify the time part completely in this format.

See Also:
Constant Field Values

FORMAT_DB

public static final String FORMAT_DB
Format understandable by OpenSql Database yyyy-MM-dd HH:mm:ss

See Also:
Constant Field Values

FORMAT_R3

public static final String FORMAT_R3
Format understandable by R3. This is used for exchange between Abap and Java yyyyMMddHHmmss.SSS

See Also:
Constant Field Values

I_TODAY

public static final int I_TODAY
This indicates "today".

See Also:
Constant Field Values

I_UNDEFINED

public static final int I_UNDEFINED
This indicates the undefined date filter which is equal to "today" (as of November 12, 2003).

See Also:
Constant Field Values

I_TOMORROW

public static final int I_TOMORROW
This indicates Tomorrow

See Also:
Constant Field Values

I_YESTERDAY

public static final int I_YESTERDAY
This indicates Yesterday

See Also:
Constant Field Values

I_LAST_7_DAYS

public static final int I_LAST_7_DAYS
This indicates rolling last 7 days. If today is Sept 18 , it includes Sept-11 to Sept 17. This doesnt include today

See Also:
Constant Field Values

I_NEXT_7_DAYS

public static final int I_NEXT_7_DAYS
This indicates rolling next 7 days. If today is Sept 18 , it includes Sept-19 to Sept 25 end. This includes today

See Also:
Constant Field Values

I_THIS_WEEK

public static final int I_THIS_WEEK
This indicates the current week that contains "today". For example, if today is September 15 and it happens to be Wednesday, the current week contains the days from September 12 through September 18. Note that the locale is assumed to be US.

See Also:
Constant Field Values

I_LAST_WEEK

public static final int I_LAST_WEEK
This indicates the previous week in reference to "this week". For example, if today is September 15 and it happens to be Wednesday, the previous week contains the days from September 5 through September 11. Note that the locale is assumed to be US.

See Also:
Constant Field Values

I_NEXT_WEEK

public static final int I_NEXT_WEEK
This indicates the next week in reference to "this week". For example, if today is September 15 and it happens to be Wednesday, the next week contains the days from September 19 through September 25. Note that the locale is assumed to be US.

See Also:
Constant Field Values

I_LAST_30_DAYS

public static final int I_LAST_30_DAYS
This indicates rolling last 30 or 31 days. If today is Sept 18 , it includes Aug 17 to Sept 17. This doesnt include today

See Also:
Constant Field Values

I_NEXT_30_DAYS

public static final int I_NEXT_30_DAYS
This indicates rolling next 30 or 31 days. If today is Sept 18 , it includes from Sept 19 to Oct 18. This includes today

See Also:
Constant Field Values

I_THIS_MONTH

public static final int I_THIS_MONTH
This indicates the current month that contains "today". For example, if today is September 15, the current month contains the days from September 1 through September 30.

See Also:
Constant Field Values

I_LAST_MONTH

public static final int I_LAST_MONTH
This indicates the previous month in reference to "today". It includes the entire last month and the time until now in the current month. For example, if today is September 15, the last month contains the days from August 1 through September 15. Note that this is different from the idea of previous week. Previous week does not contain the days of the current week.

See Also:
Constant Field Values

I_NEXT_MONTH

public static final int I_NEXT_MONTH
This indicates the next month in reference to "today". It includes the entire next month and the time from now in the current month. For example, if today is September 15, the next month contains the days from September 15 through October 31. Note that this is different from the idea of next week. next week does not contain the days of the current week.

See Also:
Constant Field Values

I_LAST_90_DAYS

public static final int I_LAST_90_DAYS
This indicates rolling last 90/91/92 days. If today is Sept 18 , it includes Jun-17 to Sept 17. This doesnt include today

See Also:
Constant Field Values

I_NEXT_90_DAYS

public static final int I_NEXT_90_DAYS
This indicates rolling next 90/91/92 days. If today is Sept 18 , it includes Sept19 to Dec 19th. This includes today

See Also:
Constant Field Values

I_LAST_3_MONTHS

public static final int I_LAST_3_MONTHS
This indicates the previous three months in reference to "today". It includes the entire last three month period and the time until now in the current month. For example, if today is September 15, the last three months contain the days from June 1 through September 15. Note that this is different from the idea of previous week. Previous week does not contain the days of the current week.

See Also:
Constant Field Values

I_NEXT_3_MONTHS

public static final int I_NEXT_3_MONTHS
This indicates the next three months in reference to "today". It includes the entire next three month period and the time from now in the current month. For example, if today is September 15, the next three months contain the days from September 15 through December 31. Note that this is different from the idea of next week. next week does not contain the days of the current week.

See Also:
Constant Field Values

I_LAST_365_DAYS

public static final int I_LAST_365_DAYS
This indicates rolling last 365 or 366 days. If today is Sept 18 , it includes last year Sept-17 to Sept 17 this year. This doesnt include today

See Also:
Constant Field Values

I_NEXT_365_DAYS

public static final int I_NEXT_365_DAYS
This indicates rolling last 365 or 366 days. If today is Sept 18 , it includes Sept-19 to Sept 18 next year. This includes today

See Also:
Constant Field Values

I_THIS_YEAR

public static final int I_THIS_YEAR
This indicates this year that contains "today". For example, if today is September 15, 2003, this year contains the days from January 1, 2003 through December 31, 2003.

See Also:
Constant Field Values

I_LAST_YEAR

public static final int I_LAST_YEAR
This indicates the last year in reference to "this year". For example, if today is September 15, 2003, the last year contains the days from January 1, 2002 through December 31, 2002.

See Also:
Constant Field Values

I_NEXT_YEAR

public static final int I_NEXT_YEAR
This indicates the next year in reference to "this year". For example, if today is September 15, 2003, the next year contains the days from January 1, 2004 through December 31, 2004.

See Also:
Constant Field Values

TODAY

public static final DateFilterEnum TODAY
This indicates "today". The text is Today.


YESTERDAY

public static final DateFilterEnum YESTERDAY
This indicates "Yesterday". The text is Yesterday.


LAST_7_DAYS

public static final DateFilterEnum LAST_7_DAYS
This indicates "Last_7_Days". Doesnt include today. The text is Last_7_Days.


NEXT_7_DAYS

public static final DateFilterEnum NEXT_7_DAYS
This indicates "Next_7_Days". Doesnt include today. The text is Next_7_Days.


LAST_WEEK

public static final DateFilterEnum LAST_WEEK
This indicates the previous week in reference to "this week". For example, if today is September 15 and it happens to be Wednesday, the previous week contains the days from September 5 through September 11. Note that the locale is assumed to be US. The text equals LastWeek.


LAST_30_DAYS

public static final DateFilterEnum LAST_30_DAYS
This indicates "Last_30_Days".Doesnt include today. The text is Last_30_Days.


NEXT_30_DAYS

public static final DateFilterEnum NEXT_30_DAYS
This indicates "Next_30_Days".Doesnt include today. The text is Next_30_Days.


LAST_MONTH

public static final DateFilterEnum LAST_MONTH
This indicates the previous month in reference to "today". It includes the entire last month and the time until now in the current month. For example, if today is September 15, the last month contains the days from August 1 through September 15. Note that this is different from the idea of previous week. Previous week does not contain the days of the current week. The text equals LastMonth.


LAST_3_MONTHS

public static final DateFilterEnum LAST_3_MONTHS
This indicates the previous three months in reference to "today". It includes the entire last three month period and the time until now in the current month. For example, if today is September 15, the last three months contain the days from June 1 through September 15. Note that this is different from the idea of previous week. Previous week does not contain the days of the current week. The text equals Last_3_Months.


LAST_90_DAYS

public static final DateFilterEnum LAST_90_DAYS
This indicates "Last_90_Days". Doesnt include today. The text is Last_90_Days.


NEXT_90_DAYS

public static final DateFilterEnum NEXT_90_DAYS
This indicates "Next_90_Days". Doesnt include today. The text is Next_90_Days.


LAST_YEAR

public static final DateFilterEnum LAST_YEAR
This indicates the last year in reference to "this year". For example, if today is September 15, 2003, the last year contains the days from January 1, 2002 through December 31, 2002. The text equals LastYear.


LAST_365_DAYS

public static final DateFilterEnum LAST_365_DAYS
This indicates "Last_365_Days". Doesnt include today. The text is Last_365_Days.


NEXT_365_DAYS

public static final DateFilterEnum NEXT_365_DAYS
This indicates "Next_365_Days". Doesnt include today. The text is Next_365_Days.


TOMORROW

public static final DateFilterEnum TOMORROW
This indicates "Tomorrow". The text is Tomorrow.


UNDEFINED

public static final DateFilterEnum UNDEFINED
This indicates the undefined date filter which is equal to "today" (as of November 12, 2003). The text value equals undefined.


THIS_WEEK

public static final DateFilterEnum THIS_WEEK
This indicates the current week that contains "today". For example, if today is September 15 and it happens to be Wednesday, the current week contains the days from September 12 through September 18. Note that the locale is assumed to be US. The text equals ThisWeek.


NEXT_WEEK

public static final DateFilterEnum NEXT_WEEK
This indicates the next week in reference to "this week". For example, if today is September 15 and it happens to be Wednesday, the next week contains the days from September 19 through September 25. Note that the locale is assumed to be US. The text equals NextWeek.


THIS_MONTH

public static final DateFilterEnum THIS_MONTH
This indicates the current month that contains "today". For example, if today is September 15, the current month contains the days from September 1 through September 30. The text equals ThisMonth.


NEXT_MONTH

public static final DateFilterEnum NEXT_MONTH
This indicates the next month in reference to "today". It includes the entire next month and the time from now in the current month. For example, if today is September 15, the next month contains the days from September 15 through October 31. Note that this is different from the idea of next week. next week does not contain the days of the current week. The text equals NextMonth.


NEXT_3_MONTHS

public static final DateFilterEnum NEXT_3_MONTHS
This indicates the next three months in reference to "today". It includes the entire next three month period and the time from now in the current month. For example, if today is September 15, the next three months contain the days from September 15 through December 31. Note that this is different from the idea of next week. next week does not contain the days of the current week. The text equals Next_3_Months.


THIS_YEAR

public static final DateFilterEnum THIS_YEAR
This indicates this year that contains "today". For example, if today is September 15, 2003, this year contains the days from January 1, 2003 through December 31, 2003. The text equals ThisYear.


NEXT_YEAR

public static final DateFilterEnum NEXT_YEAR
This indicates the next year in reference to "this year". For example, if today is September 15, 2003, the next year contains the days from January 1, 2004 through December 31, 2004. The text equals NextYear.

Method Detail

hashCode

public int hashCode()
Returns:
int the hashCode which is equal to the hashCode of text.
See Also:
Object.hashCode()

getValue

public String getValue()
Returns:
String the text.

toString

public String toString()
Returns:
String the text.
See Also:
Object.toString()

getText

public String getText()
Returns the readable text like "Today","LastWeek" etc.


getText

public String getText(Locale locale)
Return the Display text for this enum type. If the text can not be found in the resource bundle The enum key is returned.

Parameters:
locale - - Locale can be null in which the default locale will be used.
Returns:
not null

getType

public int getType()
Returns:
int the type.

getIterator

public static Iterator getIterator()
Returns:
Iterator the iterator on the values of the map that contains various date filters.
See Also:
Map.values()

getEnumFromKey

public static DateFilterEnum getEnumFromKey(String key)
Parameters:
key - that specifies the date filter.
Returns:
DateFilterEnum matches the key. If the key cannot be found in the map of date filters, or key is null, return UNDEFINED.

getUtcFormatter

public static SimpleDateFormat getUtcFormatter(String format,
                                               Locale loc)
returns UTC timezone formatter to be used for formatting the strings.

Parameters:
format - not null
loc - if null, default is used.
Returns:
not null

equals

public boolean equals(Object obj)
Parameters:
obj - the object that needs to be compared against "this".
Returns:
boolean true if the date filters are the same and false otherwise. Note that it uses string comparison on text.
See Also:
Object.equals(java.lang.Object)


Copyright 2006 SAP AG Complete Copyright Notice