org.apache.openjpa.util
Class ProxyGregorianCalendar

java.lang.Object
  extended by java.util.Calendar
      extended by java.util.GregorianCalendar
          extended by org.apache.openjpa.util.ProxyGregorianCalendar
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Calendar>, Proxy, ProxyCalendar

public class ProxyGregorianCalendar
extends GregorianCalendar
implements ProxyCalendar

Extension of the Calendar type that calls the dirty method on its owning persistence capable instance on modification. This class does not support modification via any deprecated method of the date class.

Author:
Marc Prud'hommeaux
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.GregorianCalendar
AD, BC
 
Fields inherited from class java.util.Calendar
AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET
 
Constructor Summary
ProxyGregorianCalendar()
           
ProxyGregorianCalendar(int year, int month, int dayOfMonth)
           
ProxyGregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay, int minute)
           
ProxyGregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay, int minute, int second)
           
ProxyGregorianCalendar(Locale aLocale)
           
ProxyGregorianCalendar(TimeZone zone)
           
ProxyGregorianCalendar(TimeZone zone, Locale aLocale)
           
 
Method Summary
 void add(int field, int amount)
           
protected  void computeFields()
           
 Object copy(Object orig)
          Return an unproxied copy of the given instance.
 ChangeTracker getChangeTracker()
          Return the change tracker for this proxy, or null if none.
 OpenJPAStateManager getOwner()
          Return the owning object.
 int getOwnerField()
          Return the owning field index.
 ProxyCalendar newInstance(TimeZone timeZone)
          Return a new instance of this calendar type.
 void roll(int field, boolean up)
           
 void roll(int field, int amount)
           
 void set(int field, int value)
           
 void setFirstDayOfWeek(int value)
           
 void setLenient(boolean lenient)
           
 void setMinimalDaysInFirstWeek(int value)
           
 void setOwner(OpenJPAStateManager sm, int field)
          Reset the state of the proxy, and set the owning instance of the proxy and the name of the field it is assigned to.
 void setTimeInMillis(long millis)
           
 void setTimeZone(TimeZone value)
           
protected  Object writeReplace()
           
 
Methods inherited from class java.util.GregorianCalendar
clone, computeTime, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, getTimeZone, hashCode, isLeapYear, setGregorianChange
 
Methods inherited from class java.util.Calendar
after, before, clear, clear, compareTo, complete, get, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, internalGet, isLenient, isSet, set, set, set, setTime, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProxyGregorianCalendar

public ProxyGregorianCalendar()

ProxyGregorianCalendar

public ProxyGregorianCalendar(int year,
                              int month,
                              int dayOfMonth)

ProxyGregorianCalendar

public ProxyGregorianCalendar(int year,
                              int month,
                              int dayOfMonth,
                              int hourOfDay,
                              int minute)

ProxyGregorianCalendar

public ProxyGregorianCalendar(int year,
                              int month,
                              int dayOfMonth,
                              int hourOfDay,
                              int minute,
                              int second)

ProxyGregorianCalendar

public ProxyGregorianCalendar(Locale aLocale)

ProxyGregorianCalendar

public ProxyGregorianCalendar(TimeZone zone)

ProxyGregorianCalendar

public ProxyGregorianCalendar(TimeZone zone,
                              Locale aLocale)
Method Detail

newInstance

public ProxyCalendar newInstance(TimeZone timeZone)
Description copied from interface: ProxyCalendar
Return a new instance of this calendar type.

Specified by:
newInstance in interface ProxyCalendar

setOwner

public void setOwner(OpenJPAStateManager sm,
                     int field)
Description copied from interface: Proxy
Reset the state of the proxy, and set the owning instance of the proxy and the name of the field it is assigned to. Set to null to indicate that the proxy is no longer managed.

Specified by:
setOwner in interface Proxy

getOwner

public OpenJPAStateManager getOwner()
Description copied from interface: Proxy
Return the owning object.

Specified by:
getOwner in interface Proxy

getOwnerField

public int getOwnerField()
Description copied from interface: Proxy
Return the owning field index.

Specified by:
getOwnerField in interface Proxy

getChangeTracker

public ChangeTracker getChangeTracker()
Description copied from interface: Proxy
Return the change tracker for this proxy, or null if none.

Specified by:
getChangeTracker in interface Proxy

copy

public Object copy(Object orig)
Description copied from interface: Proxy
Return an unproxied copy of the given instance. This method is used by proxy managers to create backup values for use in rollback.

Specified by:
copy in interface Proxy

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException

computeFields

protected void computeFields()
Overrides:
computeFields in class GregorianCalendar

setTimeInMillis

public void setTimeInMillis(long millis)
Overrides:
setTimeInMillis in class Calendar

set

public void set(int field,
                int value)
Overrides:
set in class Calendar

add

public void add(int field,
                int amount)
Overrides:
add in class GregorianCalendar

roll

public void roll(int field,
                 boolean up)
Overrides:
roll in class GregorianCalendar

roll

public void roll(int field,
                 int amount)
Overrides:
roll in class GregorianCalendar

setTimeZone

public void setTimeZone(TimeZone value)
Overrides:
setTimeZone in class GregorianCalendar

setLenient

public void setLenient(boolean lenient)
Overrides:
setLenient in class Calendar

setFirstDayOfWeek

public void setFirstDayOfWeek(int value)
Overrides:
setFirstDayOfWeek in class Calendar

setMinimalDaysInFirstWeek

public void setMinimalDaysInFirstWeek(int value)
Overrides:
setMinimalDaysInFirstWeek in class Calendar


Copyright © 2006 Apache Software Foundation. All Rights Reserved.