|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.dragosmatachescu.hyperionUtils.HyperionCalendar
Wrapper class for java.util.GregorianCalendar most interesting methods that can be used in Hyperion Essbase as UDF - User Defined Functions.
Naming conventions:
- if the java JRE class is called String for example, the correspondent class will be called HyperionString.
- if the java JRE method is called compareTo for example, the correspondent wrapper method will be called z_compareTo, and the essbase UDF function will be
called @JString_compareTo.
- whenever possible, the wrapper function will have the same parameters as the JRE function, except the first parameter will be the java object and the function
will be static.
Ex:
str1.compareTo(str2);
becomes
z_compareTo(str1, str2).
Because hyperion does not have a correspondent data type for Date,
this class does not implement actual wrappers, but some useful operations with
date parts (years, months, days).
The methods of this class are designed to receive as parameters only String
and/or Integer data, and also return only String and/or Integer data.
We dont use hours, minutes and seconds since there is no use in Essbase for
them anyway.
Few fields from Calendar (or GregorianCalendar) used:
static int YEAR = 1;
static int MONTH = 2;
static int WEEK_OF_YEAR = 3;
static int WEEK_OF_MONTH = 4;
static int DATE = 5;
static int DAY_OF_MONTH = 5;
static int DAY_OF_YEAR = 6;
static int DAY_OF_WEEK = 7;
static int DAY_OF_WEEK_IN_MONTH = 8;
Few methods from class Calendar (or GregorianCalendar) used:
void add(int field, int amount);
boolean after(Object when);
boolean before(Object when);
boolean equals(Object obj);
int get(int field);
int getActualMaximum(int field);
int getActualMinimum(int field);
void roll(int field, int amount);
void set(int field, int value);
void set(int year, int month, int date);
The input parameters for methods in this class will mostly come as Strings from
the Years and Period dimensions in Essbase (ex: 2008, FY08, FY2008, Jan, Feb,
January, February etc.), but they will need to be converted to integer values
using methods from class HyperionString. To work easily with months, is
recommended to set UDAs with their Java integer representation:
Jan = Calendar.JANUARY = 0;
Feb = Calendar.FEBRUARY =1;
Dec = Calendar.DECEMBER = 11;
In case days are used, first day in month has value 1.
In general, if a date part is "out of bounds" (for example 32 for day of month)
the system will recalculate the whole date to a correct one. A date such as
"February 942, 1996" will be treated as being equivalent to the 941st day after February 1, 1996.
| Constructor Summary | |
HyperionCalendar()
|
|
| Method Summary | |
static void |
main(java.lang.String[] args)
There is no function that returns void or has benefic side-effects from running, no need for a main method to be able to use RUNJAVA in calcscript Essbase. |
static int |
z_add_currentDate(int field,
int amount,
int readfield)
Pseudo-wrapper for: void add(int field, int amount). |
static int |
z_add_customDate(int year,
int month,
int day,
int field,
int amount,
int readfield)
Pseudo-wrapper for: void add(int field, int amount). |
static boolean |
z_after_currentDate(int year2,
int month2,
int day2)
Pseudo-wrapper for: boolean after(Object when). |
static boolean |
z_after_customDate(int year,
int month,
int day,
int year2,
int month2,
int day2)
Pseudo-wrapper for: boolean after(Object when). |
static boolean |
z_before_currentDate(int year2,
int month2,
int day2)
Pseudo-wrapper for: boolean before(Object when). |
static boolean |
z_before_customDate(int year,
int month,
int day,
int year2,
int month2,
int day2)
Pseudo-wrapper for: boolean before(Object when). |
static boolean |
z_equals_currentDate(int year2,
int month2,
int day2)
Pseudo-wrapper for: boolean equals(Object obj). |
static boolean |
z_equals_customDate(int year,
int month,
int day,
int year2,
int month2,
int day2)
Pseudo-wrapper for: boolean equals(Object obj). |
static int |
z_get_currentDate(int field)
Pseudo-wrapper for: int get(int field). |
static int |
z_get_customDate(int year,
int month,
int day,
int field)
Pseudo-wrapper for: int get(int field). |
static int |
z_getActualMaximum_currentDate(int field)
Pseudo-wrapper for: int getActualMaximum(int field). |
static int |
z_getActualMaximum_customDate(int year,
int month,
int day,
int field)
Pseudo-wrapper for: int getActualMaximum(int field). |
static int |
z_getActualMinimum_currentDate(int field)
Pseudo-wrapper for: int getActualMinimum(int field). |
static int |
z_getActualMinimum_customDate(int year,
int month,
int day,
int field)
Pseudo-wrapper for: int getActualMinimum(int field). |
static int |
z_roll_currentDate(int field,
int amount,
int readfield)
Pseudo-wrapper for: void roll(int field, int amount). |
static int |
z_roll_customDate(int year,
int month,
int day,
int field,
int amount,
int readfield)
Pseudo-wrapper for: void roll(int field, int amount). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HyperionCalendar()
| Method Detail |
public static int z_add_currentDate(int field,
int amount,
int readfield)
public static int z_add_customDate(int year,
int month,
int day,
int field,
int amount,
int readfield)
public static boolean z_after_currentDate(int year2,
int month2,
int day2)
public static boolean z_after_customDate(int year,
int month,
int day,
int year2,
int month2,
int day2)
public static boolean z_before_currentDate(int year2,
int month2,
int day2)
public static boolean z_before_customDate(int year,
int month,
int day,
int year2,
int month2,
int day2)
public static boolean z_equals_currentDate(int year2,
int month2,
int day2)
public static boolean z_equals_customDate(int year,
int month,
int day,
int year2,
int month2,
int day2)
public static int z_get_currentDate(int field)
public static int z_get_customDate(int year,
int month,
int day,
int field)
public static int z_getActualMaximum_currentDate(int field)
public static int z_getActualMaximum_customDate(int year,
int month,
int day,
int field)
public static int z_getActualMinimum_currentDate(int field)
public static int z_getActualMinimum_customDate(int year,
int month,
int day,
int field)
public static int z_roll_currentDate(int field,
int amount,
int readfield)
public static int z_roll_customDate(int year,
int month,
int day,
int field,
int amount,
int readfield)
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||