org.jpox.sco
Class GregorianCalendar

java.lang.Object
  extended byjava.util.Calendar
      extended byjava.util.GregorianCalendar
          extended byorg.jpox.sco.GregorianCalendar
All Implemented Interfaces:
java.lang.Cloneable, SCO, java.io.Serializable
Direct Known Subclasses:
GregorianCalendarJDK14

public class GregorianCalendar
extends java.util.GregorianCalendar
implements SCO

A mutable second-class GregorianCalendar object.

Version:
$Revision: 1.18 $
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
GregorianCalendar(StateManager ownerSM, java.lang.String fieldName)
          Creates a GregorianCalendar object that represents the time at which it was allocated.
 
Method Summary
 void add(int field, int amount)
          Method to add an amount to a field
 void attachCopy(java.lang.Object value)
          Method to return an attached version for the passed StateManager and field, using the passed value.
 java.lang.Object clone()
          Creates and returns a copy of this object.
 void detach(FetchPlanState state)
          Method to detach this object.
 java.lang.Object detachCopy(FetchPlanState state)
          Method to return a detached copy of the value object.
 java.lang.String getFieldName()
          Accessor for the field name
 java.lang.Object getOwner()
          Accessor for the owner.
 void makeDirty()
          Utility to mark the object as dirty
 void makeTransient(FetchPlanState state)
          Method to make transient this object.
 void roll(int field, boolean up)
          Method to roll a field by 1.
 void roll(int field, int amount)
          Method to roll the value of a field
 void runReachability(java.util.Set reachables)
          Method to run reachability on this SCO.
 void setFirstDayOfWeek(int value)
          Method to set the first day of the week
 void setGregorianChange(java.util.Date date)
          Method to set the gregorian cal change date
 void setLenient(boolean lenient)
          Method to set the lenient setting
 void setMinimalDaysInFirstWeek(int value)
          Method to set the minimal days in the week
 void setTimeInMillis(long millis)
          Method to set the time in milliseconds
 void setTimeZone(java.util.TimeZone value)
          Method to set the timezone
 void setValueFrom(java.lang.Object o, boolean forUpdate)
          Mutator for the value, using an object.
 void unsetOwner()
          Utility to unset the owner.
protected  java.lang.Object writeReplace()
          The writeReplace method is called when ObjectOutputStream is preparing to write the object to the stream.
 
Methods inherited from class java.util.GregorianCalendar
computeFields, computeTime, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, hashCode, isLeapYear
 
Methods inherited from class java.util.Calendar
after, before, clear, clear, complete, get, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, getTimeZone, internalGet, isLenient, isSet, set, set, set, set, setTime, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GregorianCalendar

public GregorianCalendar(StateManager ownerSM,
                         java.lang.String fieldName)
Creates a GregorianCalendar object that represents the time at which it was allocated. Assigns owning object and field name.

Parameters:
ownerSM - the owning object
fieldName - the owning field name
Method Detail

setValueFrom

public void setValueFrom(java.lang.Object o,
                         boolean forUpdate)
Mutator for the value, using an object.

Specified by:
setValueFrom in interface SCO
Parameters:
o - The Object
forUpdate - Whether to update the datastore with this value

unsetOwner

public void unsetOwner()
Utility to unset the owner.

Specified by:
unsetOwner in interface SCO

getOwner

public java.lang.Object getOwner()
Accessor for the owner.

Specified by:
getOwner in interface SCO
Returns:
The owner

getFieldName

public java.lang.String getFieldName()
Accessor for the field name

Specified by:
getFieldName in interface SCO
Returns:
The field name

makeDirty

public void makeDirty()
Utility to mark the object as dirty


runReachability

public void runReachability(java.util.Set reachables)
Method to run reachability on this SCO.

Specified by:
runReachability in interface SCO
Parameters:
reachables - List of StateManagers reachable so far

makeTransient

public void makeTransient(FetchPlanState state)
Method to make transient this object.

Specified by:
makeTransient in interface SCO
Parameters:
state - State for the fetchplan process

detach

public void detach(FetchPlanState state)
Method to detach this object.

Specified by:
detach in interface SCO
Parameters:
state - State for the detachment process

detachCopy

public java.lang.Object detachCopy(FetchPlanState state)
Method to return a detached copy of the value object.

Specified by:
detachCopy in interface SCO
Parameters:
state - State for detachment process
Returns:
The detached copy

attachCopy

public void attachCopy(java.lang.Object value)
Method to return an attached version for the passed StateManager and field, using the passed value.

Specified by:
attachCopy in interface SCO
Parameters:
value - The new value

clone

public java.lang.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.

Specified by:
clone in interface SCO
Returns:
A clone of the object

writeReplace

protected java.lang.Object writeReplace()
                                 throws java.io.ObjectStreamException
The writeReplace method is called when ObjectOutputStream is preparing to write the object to the stream. The ObjectOutputStream checks whether the class defines the writeReplace method. If the method is defined, the writeReplace method is called to allow the object to designate its replacement in the stream. The object returned should be either of the same type as the object passed in or an object that when read and resolved will result in an object of a type that is compatible with all references to the object.

Returns:
the replaced object
Throws:
java.io.ObjectStreamException

add

public void add(int field,
                int amount)
Method to add an amount to a field

Parameters:
field - The field
amount - The amount to add

roll

public void roll(int field,
                 boolean up)
Method to roll a field by 1.

Parameters:
field - The field
up - The whether to move it up

roll

public void roll(int field,
                 int amount)
Method to roll the value of a field

Parameters:
field - The field
amount - The amount to roll by

setGregorianChange

public void setGregorianChange(java.util.Date date)
Method to set the gregorian cal change date

Parameters:
date - The new change date

setFirstDayOfWeek

public void setFirstDayOfWeek(int value)
Method to set the first day of the week

Parameters:
value - The first day of the week

setLenient

public void setLenient(boolean lenient)
Method to set the lenient setting

Parameters:
lenient - Whether it is lenient

setMinimalDaysInFirstWeek

public void setMinimalDaysInFirstWeek(int value)
Method to set the minimal days in the week

Parameters:
value - The minimal days in the week

setTimeInMillis

public void setTimeInMillis(long millis)
Method to set the time in milliseconds

Parameters:
millis - The new time in millisecs

setTimeZone

public void setTimeZone(java.util.TimeZone value)
Method to set the timezone

Parameters:
value - The new timezone


Copyright © -2007 . All Rights Reserved.