goodsjpi
Class Date

java.lang.Object
  extended byjava.util.Date
      extended bygoodsjpi.Date
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

public class Date
extends java.util.Date

The class Date is a wrapper for java.util.Date class which prevents Date object from been modified. So value semantic can be used for this class. It allows GOODS to store Date object as binary field without creating extra persistent object in the storage.

See Also:
Serialized Form

Constructor Summary
Date()
          Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.
Date(int year, int month, int date)
          Deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date) or GregorianCalendar(year + 1900, month, date).
Date(int year, int month, int date, int hrs, int min)
          Deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min) or GregorianCalendar(year + 1900, month, date, hrs, min).
Date(int year, int month, int date, int hrs, int min, int sec)
          Deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min, sec) or GregorianCalendar(year + 1900, month, date, hrs, min, sec).
Date(long date)
          Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
Date(java.lang.String s)
          Deprecated. As of JDK version 1.1, replaced by DateFormat.parse(String s).
 
Method Summary
 void setDate(int date)
           
 void setHours(int hours)
           
 void setMinutes(int minutes)
           
 void setMonth(int month)
           
 void setSeconds(int seconds)
           
 void setTime(long time)
           
 void setYear(int year)
           
 
Methods inherited from class java.util.Date
after, before, clone, compareTo, compareTo, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, toGMTString, toLocaleString, toString, UTC
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Date

public Date()
Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.

See Also:
System.currentTimeMillis()

Date

public Date(long date)
Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.

Parameters:
date - the milliseconds since January 1, 1970, 00:00:00 GMT.
See Also:
System.currentTimeMillis()

Date

public Date(int year,
            int month,
            int date)
Deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date) or GregorianCalendar(year + 1900, month, date).

Allocates a Date object and initializes it so that it represents midnight, local time, at the beginning of the day specified by the year, month, and date arguments.

Parameters:
year - the year minus 1900.
month - the month between 0-11.
date - the day of the month between 1-31.
See Also:
Calendar

Date

public Date(int year,
            int month,
            int date,
            int hrs,
            int min)
Deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min) or GregorianCalendar(year + 1900, month, date, hrs, min).

Allocates a Date object and initializes it so that it represents the instant at the start of the minute specified by the year, month, date, hrs, and min arguments, in the local time zone.

Parameters:
year - the year minus 1900.
month - the month between 0-11.
date - the day of the month between 1-31.
hrs - the hours between 0-23.
min - the minutes between 0-59.
See Also:
Calendar

Date

public Date(int year,
            int month,
            int date,
            int hrs,
            int min,
            int sec)
Deprecated. As of JDK version 1.1, replaced by Calendar.set(year + 1900, month, date, hrs, min, sec) or GregorianCalendar(year + 1900, month, date, hrs, min, sec).

Allocates a Date object and initializes it so that it represents the instant at the start of the second specified by the year, month, date, hrs, min, and sec arguments, in the local time zone.

Parameters:
year - the year minus 1900.
month - the month between 0-11.
date - the day of the month between 1-31.
hrs - the hours between 0-23.
min - the minutes between 0-59.
sec - the seconds between 0-59.
See Also:
Calendar

Date

public Date(java.lang.String s)
Deprecated. As of JDK version 1.1, replaced by DateFormat.parse(String s).

Allocates a Date object and initializes it so that it represents the date and time indicated by the string s, which is interpreted as if by the Date.parse(java.lang.String) method.

Parameters:
s - a string representation of the date.
See Also:
Date.parse(java.lang.String)
Method Detail

setYear

public void setYear(int year)

setMonth

public void setMonth(int month)

setDate

public void setDate(int date)

setHours

public void setHours(int hours)

setMinutes

public void setMinutes(int minutes)

setSeconds

public void setSeconds(int seconds)

setTime

public void setTime(long time)