org.ocopomo.date
Class DateFacilities

java.lang.Object
  extended by org.ocopomo.date.DateFacilities

public class DateFacilities
extends java.lang.Object


Field Summary
static int DATELENGTH
           
 
Constructor Summary
DateFacilities()
           
 
Method Summary
static boolean areInSameYear(double tick1, double tick2)
          Check whether the two given ticks represents a couple of dates that belong to the same year
static int[] date(double tick)
          Converts a tick to a date (in the format week - 0 to 3 in a month, month - 0 to 11 and year - 48 weeks.
static boolean isBudgetTime(double tick)
          Check whether the given tick represents the first week of the year
static java.lang.Boolean isEqualTimestampDate(double tick, int[] date)
           
static java.lang.Boolean isEqualTimestampDate(double tick, int week, int month, int year)
          Checks whether a tick and a week/month/year-date represent the same date
static double tick(int[] date)
          Converts a date (in the format week - 0 to 3 in a month, month - 0 to 11 and year - 48 weeks.
static double tick(int w, int m, int y)
          Converts a date (in the format week - 0 to 3 in a month, month - 0 to 11 and year - 48 weeks.
static void updateDate(org.ocopomo.drams.data.FactBase factBase, double tick)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATELENGTH

public static final int DATELENGTH
See Also:
Constant Field Values
Constructor Detail

DateFacilities

public DateFacilities()
Method Detail

date

public static int[] date(double tick)
Converts a tick to a date (in the format week - 0 to 3 in a month, month - 0 to 11 and year - 48 weeks. In synthesis: 4 weeks/month, 12 months/year)

Parameters:
tick - The tick of the model
Returns:
An array of integers (week[0-3], month[0-11], year[0-...])

tick

public static double tick(int[] date)
Converts a date (in the format week - 0 to 3 in a month, month - 0 to 11 and year - 48 weeks. In synthesis: 4 weeks/month, 12 months/year) to a tick.

Parameters:
int - An array of int that expresses a date in the format {week, month, year}
Returns:
The date (week[0-3], month[0-11], year[0-...]) converted to the corresponding tick value

tick

public static double tick(int w,
                          int m,
                          int y)
Converts a date (in the format week - 0 to 3 in a month, month - 0 to 11 and year - 48 weeks. In synthesis: 4 weeks/month, 12 months/year) to a tick.

Parameters:
-
int - An array of int that expresses a date in the format {week, month, year}
w - the week [0-3 values]
m - the month [0-11 values]
y - the year [0-... values]
Returns:
The date (week[0-3], month[0-11], year[0-...]) converted to the corresponding tick value

isEqualTimestampDate

public static java.lang.Boolean isEqualTimestampDate(double tick,
                                                     int[] date)

isEqualTimestampDate

public static java.lang.Boolean isEqualTimestampDate(double tick,
                                                     int week,
                                                     int month,
                                                     int year)
Checks whether a tick and a week/month/year-date represent the same date

Parameters:
tick -
week -
month -
year -
Returns:
true if they represent the same date, else false

areInSameYear

public static boolean areInSameYear(double tick1,
                                    double tick2)
Check whether the two given ticks represents a couple of dates that belong to the same year

Parameters:
tick1 - The first tick to compare
tick2 - The second tick to compare
Returns:
True if the two ticks belong to the same year, false otherwise.

isBudgetTime

public static boolean isBudgetTime(double tick)
Check whether the given tick represents the first week of the year

Parameters:
tick - The tick to check
Returns:
True if given tick represents the first week of the year, false otherwise.

updateDate

public static void updateDate(org.ocopomo.drams.data.FactBase factBase,
                              double tick)
Parameters:
factBase -
tick -