BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.jdbc.informix4
Class Day

java.lang.Object
  |
  +--weblogic.jdbc.informix4.Day

public class Day
extends java.lang.Object
implements java.lang.Cloneable

Author:
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.

Constructor Summary
Day()
          Constructs today's date
Day(int yyyy, int m, int d)
          Constructs a specific date
 
Method Summary
 void advance(int n)
          Advances this day by n days.
 void advanceMonths(int n)
          Advances this day by n months worth of days.
 void advanceYears(int n)
          Advances this day by n years worth of days.
 java.lang.Object clone()
          Makes a bitwise copy of a Day object
 int daysBetween(Day b)
          The number of days between this and day parameter
protected  int daysInMonth(int inMonth, int inYear)
           
protected  int daysInYear(int inYear)
          Returns the number of days in a given year.
 int getDay()
           
 int getMonth()
           
 int getYear()
           
protected  boolean gregorianLeapYear(int inYear)
          Returns true if the year is a Gregorian leap year.
protected  int julianDaysInMonth(int inMonth, int inYear)
          Returns the number of days in a given month and year assuming Julian calandar.
protected  boolean julianLeapYear(int inYear)
          Returns true if the year is a Julian leap year.
 java.lang.String toString()
          A string representation of the day
 int weekday()
          Gets the weekday
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Day

public Day()
Constructs today's date

Day

public Day(int yyyy,
           int m,
           int d)
Constructs a specific date

Parameters:
yyyy - year (full year, e.g., 1996, not starting from 1900)
m - month
d - day
Throws:
java.lang.IllegalArgumentException - if yyyy m d not a valid date
Method Detail

advance

public void advance(int n)
Advances this day by n days. For example. d.advance(30) adds thirdy days to d

Parameters:
n - the number of days by which to change this day (can be < 0)

gregorianLeapYear

protected boolean gregorianLeapYear(int inYear)
Returns true if the year is a Gregorian leap year.

Note: This method only works for years from -7 to 3199

Parameters:
inYear - to check
Returns:
true if the year is a leap year

julianLeapYear

protected boolean julianLeapYear(int inYear)
Returns true if the year is a Julian leap year.

Note: This method only works for years from -7 to 1582

Parameters:
inYear - to check
Returns:
true if the year is a leap year

julianDaysInMonth

protected int julianDaysInMonth(int inMonth,
                                int inYear)
Returns the number of days in a given month and year assuming Julian calandar.

Note: This method only works for years from -7 to 09.1582.

Parameters:
inMonth - is the month to get the number of days for.
inYear - is the year we want days in inMonth for.
Returns:
number of days in a given month

daysInMonth

protected int daysInMonth(int inMonth,
                          int inYear)


daysInYear

protected int daysInYear(int inYear)
Returns the number of days in a given year.

Note: This method only works for years from -7 to 3199.

Parameters:
inYear - is the year to get the number of days for.
Returns:
number of days in a given year

advanceMonths

public void advanceMonths(int n)
Advances this day by n months worth of days.

Parameters:
n - the number of months by which to change the day (can be not be < 0)

advanceYears

public void advanceYears(int n)
Advances this day by n years worth of days.

Parameters:
n - the number of years by which to change the day (can be not be < 0)

getDay

public int getDay()


getMonth

public int getMonth()


getYear

public int getYear()


weekday

public int weekday()
Gets the weekday

Returns:
the weekday (0 = Sunday, 1 = Monday, ..., 6 = Saturday)

daysBetween

public int daysBetween(Day b)
The number of days between this and day parameter

Parameters:
b - any date
Returns:
the number of days between this and day parameter and b (> 0 if this day comes after b)

toString

public java.lang.String toString()
A string representation of the day

Returns:
a string representation of the day
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Makes a bitwise copy of a Day object

Returns:
a bitwise copy of a Day object
Overrides:
clone in class java.lang.Object

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.