All Packages Class Hierarchy This Package Previous Next Index
Class etm.etmDate
java.lang.Object
|
+----etm.etmDate
- public class etmDate
- extends Object
An enhanced Date storage and manipulation class. Can be used to storing
any dates from 0 to 9999 years A.D. (without a time). Contains methods
for processing Julian and Gregorian dates, calculating intervals from date
to date in days, date shifting, Julian/Gregorian converting, and Ecclesiastcal
Easter calculation by the Gauss method.
ENG
- The language is English
GRE
- The style is Gregorian
JUL
- The style is Julian
LEAP
- The Year is leap
RUS
- The language is Russian
SIMPLE
- The Year is Simple (not leap)
etmDate()
- Creates today's date in Gregorian style.
etmDate(boolean)
- Creates today's date in definite style.
etmDate(int,
int, int)
- Creates a date in Gregorian style.
etmDate(int,
int, int, boolean)
- Creates a date in definite style.
etmDate(Date)
- Creates a date in Gregorian style.
etmDate(Date,
boolean)
- Creates a date in definite style.
DayOfWeek()
- "Perpetual" calendar.
getEasterDate()
- Returns the Ecclesiastical Easter date in the year.
getLanguage()
- Returns a current language of string performance of date.
getStyle()
- Returns a style of defined date.
getStyleDiff()
- Returns a difference between Julian and Gregorian in century of defined
date.
isGregorian()
- Returns true if style is Gregorian, else returns false.
isRussian()
- Returns true if current language is Russian, else returns false.
is_leap(int)
- Returns true if the year of specified date is leap, else returns false
moveTo(long)
- Date shifting forward or backward.
setLanguage(boolean)
- Changes a current language of date string performance.
setStyle(boolean)
- Changes a current style.
subDate(etmDate)
- Returns signed number of days between the date and the other date.
toGregorian()
- Converts the date to a Gregorian style.
toJulian()
- Converts the date to a Julian style.
toString()
- Converts a date to a String, using the specified language.
RUS
public final static boolean RUS
- The language is Russian
ENG
public final static boolean ENG
- The language is English
LEAP
public final static boolean LEAP
- The Year is leap
SIMPLE
public final static boolean SIMPLE
- The Year is Simple (not leap)
GRE
public final static boolean GRE
- The style Gregorian
JUL
public final static boolean JUL
- The style Julian
etmDate
public etmDate()
- Creates today's date in Gregorian style.
etmDate
public etmDate(boolean defStyle)
- Creates today's date in definite style.
- Parameters:
- defStyle - A predefinite style: etmDate.GRE or etmDate.JUL
etmDate
public etmDate(int d,
int m,
int y) throws IllegalArgumentException
- Creates a date in Gregorian style.
- Parameters:
- d - Day
- m - Month
- y - Year
etmDate
public etmDate(int d,
int m,
int y,
boolean defStyle) throws IllegalArgumentException
- Creates a date in definite style.
- Parameters:
- d - Day
- m - Month
- y - Year
- defStyle - A predefinite style: etmDate.GRE or etmDate.JUL
etmDate
public etmDate(Date date) throws IllegalArgumentException
- Creates a date in Gregorian style.
- Parameters:
- date - A date in kind of Java.util.Date class
etmDate
public etmDate(Date date,
boolean defStyle) throws IllegalArgumentException
- Creates a date in definite style.
- Parameters:
- date - A date in kind of Java.util.Date class
- defStyle - A predefinite style: etmDate.GRE or etmDate.JUL
getStyleDiff
public int getStyleDiff()
- Returns a difference between Julian and Gregorian in century of defined
date. (+13 for our century)
getStyle
public boolean getStyle()
- Returns a style of defined date. ( etmDate.GRE or etmDate.JUL )
isGregorian
public boolean isGregorian()
- Returns true if style is Gregorian, else returns false.
setStyle
public void setStyle(boolean defStyle)
- Changes a current style.
- Parameters:
- defStyle - A predefinite style: etmDate.GRE or etmDate.JUL
getLanguage
public boolean getLanguage()
- Returns a current language of string performance of date. ( etmDate.RUS
or etmDate.ENG )
isRussian
public boolean isRussian()
- Returns true if current language is Russian, else returns false.
setLanguage
public void setLanguage(boolean newLanguage)
- Changes a current language of date string performance. (From English
to Russian and back).
- Parameters:
- newLanguage - A predefinite language: etmDate.RUS or etmDate.ENG
DayOfWeek
public int DayOfWeek()
- "Perpetual" calendar. Returns a day-of-the-week for date
specified in current style. ( 0 - Sunday, ... 6 - Saturday )
toString
public String toString()
- Converts a date to a String, using the specified language.
- Overrides:
- toString in class Object
toJulian
public etmDate toJulian()
- Converts the date to a Julian style.
- Returns:
- Julian style date (if the date already is Julian, returns the same).
toGregorian
public etmDate toGregorian()
- Converts the date to a Gregorian style.
- Returns:
- Gregorian style date (if the date already is Gregorian, returns the
same).
getEasterDate
public etmDate getEasterDate()
- Returns the Ecclesiastical Easter date in the year. in the current
style.
moveTo
public etmDate moveTo(long days)
- Date shifting forward or backward.
- Parameters:
- days - Signed number of days to shifting
- Returns:
- A shifted date
is_leap
public boolean is_leap(int year)
- Returns true if the year of specified date is leap, else returns false
subDate
public int subDate(etmDate otherDate)
- Returns signed number of days between the date and the other date.
It will be realized later
- Parameters:
- otherDate - A date, that is subtrahend
All Packages Class Hierarchy This Package Previous Next Index