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.


Variable Index

o ENG
The language is English
o GRE
The style is Gregorian
o JUL
The style is Julian
o LEAP
The Year is leap
o RUS
The language is Russian
o SIMPLE
The Year is Simple (not leap)

Constructor Index

o etmDate()
Creates today's date in Gregorian style.
o etmDate(boolean)
Creates today's date in definite style.
o etmDate(int, int, int)
Creates a date in Gregorian style.
o etmDate(int, int, int, boolean)
Creates a date in definite style.
o etmDate(Date)
Creates a date in Gregorian style.
o etmDate(Date, boolean)
Creates a date in definite style.

Method Index

o DayOfWeek()
"Perpetual" calendar.
o getEasterDate()
Returns the Ecclesiastical Easter date in the year.
o getLanguage()
Returns a current language of string performance of date.
o getStyle()
Returns a style of defined date.
o getStyleDiff()
Returns a difference between Julian and Gregorian in century of defined date.
o isGregorian()
Returns true if style is Gregorian, else returns false.
o isRussian()
Returns true if current language is Russian, else returns false.
o is_leap(int)
Returns true if the year of specified date is leap, else returns false
o moveTo(long)
Date shifting forward or backward.
o setLanguage(boolean)
Changes a current language of date string performance.
o setStyle(boolean)
Changes a current style.
o subDate(etmDate)
Returns signed number of days between the date and the other date.
o toGregorian()
Converts the date to a Gregorian style.
o toJulian()
Converts the date to a Julian style.
o toString()
Converts a date to a String, using the specified language.

Variables

o RUS

  public final static boolean RUS
The language is Russian

o ENG

  public final static boolean ENG
The language is English

o LEAP

  public final static boolean LEAP
The Year is leap

o SIMPLE

  public final static boolean SIMPLE
The Year is Simple (not leap)

o GRE

  public final static boolean GRE
The style Gregorian

o JUL

  public final static boolean JUL
The style Julian

Constructors

o etmDate

  public etmDate()
Creates today's date in Gregorian style.

o etmDate

  public etmDate(boolean defStyle)
Creates today's date in definite style.
Parameters:
defStyle - A predefinite style: etmDate.GRE or etmDate.JUL

o etmDate

  public etmDate(int d,
                 int m,
                 int y) throws IllegalArgumentException
Creates a date in Gregorian style.
Parameters:
d - Day
m - Month
y - Year

o 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

o etmDate

  public etmDate(Date date) throws IllegalArgumentException
Creates a date in Gregorian style.
Parameters:
date - A date in kind of Java.util.Date class

o 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

Methods

o getStyleDiff

  public int getStyleDiff()
Returns a difference between Julian and Gregorian in century of defined date. (+13 for our century)

o getStyle

  public boolean getStyle()
Returns a style of defined date. ( etmDate.GRE or etmDate.JUL )

o isGregorian

  public boolean isGregorian()
Returns true if style is Gregorian, else returns false.

o setStyle

  public void setStyle(boolean defStyle)
Changes a current style.
Parameters:
defStyle - A predefinite style: etmDate.GRE or etmDate.JUL

o getLanguage

  public boolean getLanguage()
Returns a current language of string performance of date. ( etmDate.RUS or etmDate.ENG )

o isRussian

  public boolean isRussian()
Returns true if current language is Russian, else returns false.

o 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

o DayOfWeek

  public int DayOfWeek()
"Perpetual" calendar. Returns a day-of-the-week for date specified in current style. ( 0 - Sunday, ... 6 - Saturday )

o toString

  public String toString()
Converts a date to a String, using the specified language.
Overrides:
toString in class Object

o toJulian

  public etmDate toJulian()
Converts the date to a Julian style.
Returns:
Julian style date (if the date already is Julian, returns the same).

o toGregorian

  public etmDate toGregorian()
Converts the date to a Gregorian style.
Returns:
Gregorian style date (if the date already is Gregorian, returns the same).

o getEasterDate

  public etmDate getEasterDate()
Returns the Ecclesiastical Easter date in the year. in the current style.

o moveTo

  public etmDate moveTo(long days)
Date shifting forward or backward.
Parameters:
days - Signed number of days to shifting
Returns:
A shifted date

o is_leap

  public boolean is_leap(int year)
Returns true if the year of specified date is leap, else returns false

o 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