public abstract class HolInfo
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static boolean |
ACTUAL
base calculations on the actual date the holiday is observed.
|
static boolean |
DEBUGGING
true if debugging.
|
static int |
OBSERVED
base calculations on date holiday was first celebrated.
|
static int |
PROCLAIMED
base calculations on date holiday was first officially proclaimed.
|
static boolean |
SHIFTED
base calculations on the nearest weekday to the holiday.
|
Constructor and Description |
---|
HolInfo() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
getAuthority()
authority who provided the information about the holiday.
|
abstract int |
getFirstYear(int base)
Get year holiday first proclaimed or first celebrated.
|
abstract java.lang.String |
getName()
Get name of holiday e.g.
|
abstract java.lang.String |
getRule()
Get rule in English for how the holiday is calculated.
|
protected boolean |
isYearValid(int year,
int base)
Is year valid for this holiday?
|
(package private) static int |
shiftSatToFriSunToMon(int ordinal,
boolean shift)
convert Saturdays to preceding Friday, Sundays to following Monday.
|
int |
when(int year)
When was this holiday in a given year?, based on PROCLAIMED date.
|
int |
when(int year,
boolean shift)
When was this holiday in a given year?, based on PROCLAIMED date.
|
abstract int |
when(int year,
boolean shift,
int base)
When was this holiday in a given year?
|
public static final boolean ACTUAL
public static final boolean DEBUGGING
public static final boolean SHIFTED
public static final int OBSERVED
public static final int PROCLAIMED
public abstract java.lang.String getAuthority()
public abstract int getFirstYear(int base)
base
- PROCLAIMED=based on date holiday was officially proclaimed. CELEBRATED=based on date holiday was
first celebrated.public abstract java.lang.String getName()
public abstract java.lang.String getRule()
public final int when(int year)
year
- must be 1583 or later.public final int when(int year, boolean shift)
year
- must be 1583 or later.shift
- ACTUAL = false if you want the actual date of the holiday. SHIFTED = true if you want the date taken
off work, usually the nearest weekday.public abstract int when(int year, boolean shift, int base)
year
- (-ve means BC, +ve means AD, 0 not permitted.)shift
- ACTUAL = false if you want the actual date of the holiday. SHIFTED = true if you want the date taken
off work, usually the nearest weekday.base
- PROCLAIMED=based on date holiday was officially proclaimed CELEBRATED=based on date holiday was
first celebratedstatic int shiftSatToFriSunToMon(int ordinal, boolean shift)
ordinal
- days since 1970-01-01.shift
- ACTUAL = false if you want the actual date of the holiday. SHIFTED = true if you want the date
taken off work, usually the nearest weekday.protected final boolean isYearValid(int year, int base)
year
- The year you want to test.base
- PROCLAIMED=based on date holiday was officially proclaimed . CELEBRATED=based on date holiday was
first celebrated.