Class Date
- java.lang.Object
-
- java.util.Date
-
- com.sun.jdo.spi.persistence.support.sqlstore.sco.Date
-
- All Implemented Interfaces:
SCO
,SCODate
,Serializable
,Cloneable
,Comparable<Date>
public class Date extends Date implements SCODate
A mutable 2nd class object date.- Version:
- 1.0
- Author:
- Marina Vatkina
- See Also:
Date
, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
applyUpdates(StateManager sm, boolean modified)
Apply changes (no-op)Object
clone()
Creates and returns a copy of this object.Object
cloneInternal()
Creates and returns a copy of this object without resetting the owner and field value.String
getFieldName()
Returns the field nameObject
getOwner()
Returns the owner object of the SCO instanceStateManager
makeDirty()
Marks object dirtyvoid
setDate(int date)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.DAY_OF_MONTH, int date)
.void
setHours(int hours)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.HOUR_OF_DAY, int hours)
.void
setMinutes(int minutes)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.MINUTE, int minutes)
.void
setMonth(int month)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.MONTH, int month)
.void
setSeconds(int seconds)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.SECOND, int seconds)
.void
setTime(long time)
Sets the Date object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT.void
setTimeInternal(long time)
Sets the Date object without notification of the Owner field.void
setYear(int year)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.YEAR, year + 1900)
.void
unsetOwner()
Nullifies references to the owner Object and Field NOTE: This method should be called under the locking of the owener' state manager.-
Methods inherited from class java.util.Date
after, before, compareTo, equals, from, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, toGMTString, toInstant, toLocaleString, toString, UTC
-
-
-
-
Method Detail
-
setTime
public void setTime(long time)
Sets the Date object to represent a point in time that is time milliseconds after January 1, 1970 00:00:00 GMT.
-
clone
public Object clone()
Creates and returns a copy of this object.Mutable Second Class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.
-
setYear
public void setYear(int year)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.YEAR, year + 1900)
.Sets the year of this Date object to be the specified value plus 1900.
-
setMonth
public void setMonth(int month)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.MONTH, int month)
.Sets the month of this date to the specified value.
-
setDate
public void setDate(int date)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.DAY_OF_MONTH, int date)
.Sets the day of the month of this Date object to the specified value.
-
setHours
public void setHours(int hours)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.HOUR_OF_DAY, int hours)
.Sets the hour of this Date object to the specified value.
-
setMinutes
public void setMinutes(int minutes)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.MINUTE, int minutes)
.Sets the minutes of this Date object to the specified value.- Overrides:
setMinutes
in classDate
- Parameters:
minutes
- the value of the minutes.- See Also:
Calendar
,Date
-
setSeconds
public void setSeconds(int seconds)
Deprecated.As of JDK version 1.1, replaced byCalendar.set(Calendar.SECOND, int seconds)
.Sets the seconds of this Date to the specified value.- Overrides:
setSeconds
in classDate
- Parameters:
seconds
- the seconds value.- See Also:
Calendar
,Date
-
cloneInternal
public Object cloneInternal()
Creates and returns a copy of this object without resetting the owner and field value.- Specified by:
cloneInternal
in interfaceSCO
-
setTimeInternal
public void setTimeInternal(long time)
Sets the Date object without notification of the Owner field. Used internaly to populate date from DB- Specified by:
setTimeInternal
in interfaceSCODate
- Parameters:
time
- the number of milliseconds.- See Also:
Date
-
unsetOwner
public void unsetOwner()
Nullifies references to the owner Object and Field NOTE: This method should be called under the locking of the owener' state manager.- Specified by:
unsetOwner
in interfaceSCO
-
getOwner
public Object getOwner()
Returns the owner object of the SCO instance
-
getFieldName
public String getFieldName()
Returns the field name- Specified by:
getFieldName
in interfaceSCO
- Returns:
- field name as java.lang.String
-
makeDirty
public StateManager makeDirty()
Marks object dirty
-
applyUpdates
public void applyUpdates(StateManager sm, boolean modified)
Apply changes (no-op)- Specified by:
applyUpdates
in interfaceSCO
-
-