Oracle Fusion Applications Java API Reference for Oracle Enterprise Scheduler Service
11g Release 1 (11.1.1.5)
E20742-01


oracle.as.scheduler
Class ExplicitDate

java.lang.Object
  extended by oracle.as.scheduler.ExplicitDate
All Implemented Interfaces:
java.io.Serializable

public class ExplicitDate
extends java.lang.Object
implements java.io.Serializable

Defines a date and time for use in a Schedule or Exclusion.

While the Recurrence defines a repetition rule, instances of this class can be used for specifying explicit date/times within Schedule and Exclusion definitions. ExplicitDate can be constructed by using appropriate fields defined in the RecurrenceFields class.

The class provides the ability to define partial date (when compared with java.util.Calendar where the time part may or may not be specified. Also all other fields such as TimeZone are not defined for this class. Such explicit dates are required for defining partial dates to be included or excluded from a Schedule or an Exclusion definition. When the time is not specified in an ExplicitDate, the containing Schedule and/or Exclusion computes it appropriately.

Example:

Consider an example Schedule that indicates every Monday plus on the 17th of August 2006. Here the 17th of August 2006 is a partial date since it does not have the time part specified. This should typically be defined via an instance of ExplicitDate class.

See Also:
RecurrenceFields, Recurrence, Schedule, Exclusion, ExclusionsDefinition, Serialized Form

Constructor Summary
ExplicitDate(RecurrenceFields.YEAR year, RecurrenceFields.MONTH_OF_YEAR month, RecurrenceFields.DAY_OF_MONTH day)
          Constructs a new ExplicitDate with a year, a month and a day.
ExplicitDate(RecurrenceFields.YEAR year, RecurrenceFields.MONTH_OF_YEAR month, RecurrenceFields.DAY_OF_MONTH day, RecurrenceFields.TIME_OF_DAY time)
          Constructs a new ExplicitDate with a year, month, day and a time.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares an object for equality with this ExplicitDate object.
static ExplicitDate fromCalendar(java.util.Calendar cal, boolean useTime)
          Constructs a new instance of ExplicitDatefrom a given Calendar instance.
 RecurrenceFields.DAY_OF_MONTH getDay()
          Returns the day part of this ExplicitDate object.
 RecurrenceFields.MONTH_OF_YEAR getMonth()
          Returns the month part of this ExplicitDate object.
 RecurrenceFields.TIME_OF_DAY getTime()
          Returns the time part of this ExplicitDate object.
 RecurrenceFields.YEAR getYear()
          Returns the year part of this ExplicitDate object.
 int hashCode()
          Returns the hash code value of this ExplicitDate object.
 void setDay(RecurrenceFields.DAY_OF_MONTH day)
          Sets the day of this ExplicitDate object to the given value.
 void setMonth(RecurrenceFields.MONTH_OF_YEAR month)
          Sets the month of this ExplicitDate object to the given value.
 void setTime(RecurrenceFields.TIME_OF_DAY time)
          Sets the time of this ExplicitDate object to the given value.
 void setYear(RecurrenceFields.YEAR year)
          Sets the year of this ExplicitDate object to the given value.
 java.util.Calendar toCalendar()
          Populates this instance of ExplicitDate into an instance of Calendar.
 java.util.Calendar toCalendar(java.util.Calendar cal)
          Populates this instance of ExplicitDate into the given instance of Calendar.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExplicitDate

public ExplicitDate(RecurrenceFields.YEAR year,
                    RecurrenceFields.MONTH_OF_YEAR month,
                    RecurrenceFields.DAY_OF_MONTH day)
Constructs a new ExplicitDate with a year, a month and a day. This leaves the time part as null

Parameters:
year - - the year part for this new instance.
month - - the month part for this new instance.
day - - the day part for this new instance.

ExplicitDate

public ExplicitDate(RecurrenceFields.YEAR year,
                    RecurrenceFields.MONTH_OF_YEAR month,
                    RecurrenceFields.DAY_OF_MONTH day,
                    RecurrenceFields.TIME_OF_DAY time)
Constructs a new ExplicitDate with a year, month, day and a time.

Parameters:
year - - the year part for this new instance.
month - - the month part for this new instance.
day - - the day part for this new instance.
time - - the time part for this new instance.
Method Detail

fromCalendar

public static ExplicitDate fromCalendar(java.util.Calendar cal,
                                        boolean useTime)
Constructs a new instance of ExplicitDatefrom a given Calendar instance.

The new instance of ExplicitDate has its year, month, day parts extracted from the given Calender instance. Optionally the hour, minute and second parts are also extracted from the Calendar if specified.

All other fields such as time zone, milliseconds, etc of the Calendar instance are completely ignored.

Parameters:
cal - - instance of Calendar from which a new instance of ExplicitDate will be constructed.
useTime - - flag indicating whether the hour, minute, and second parts should also be consumed or not. If true, the new instance of ExplicitDate will have its time of day part also set from the given Calendar instance. Otherwise only year, month and day will be set.
Returns:
- an instance of ExplicitDate.

toCalendar

public java.util.Calendar toCalendar()
Populates this instance of ExplicitDate into an instance of Calendar.

The method obtains an instance of Calendar via Calendar.getInstance() and sets only the fields available in this instance of ExplicitDate leaving all other fields such as time zone of the Calendar unchanged to their current values. Therefore other fields of the Calendar will point to the values as returned by the call to Calendar.getInstance() method.

Returns:
- an instance of Calender with its fields set as per this instance of ExplicitDate.

toCalendar

public java.util.Calendar toCalendar(java.util.Calendar cal)
Populates this instance of ExplicitDate into the given instance of Calendar.

The method sets all the fields available in this object into the given Calendar. Remaining fields are left unchanged. For example, if this object does not have TIME_OF_DAY set, then the time parts of the specified Calendar instance are left unchanged.

Parameters:
cal - - the Calendar instance that will be modified with the available fields of this object.
Returns:
- the modified Calendar instance.

getYear

public RecurrenceFields.YEAR getYear()
Returns the year part of this ExplicitDate object.

Returns:
- the year represented by this object.

setYear

public void setYear(RecurrenceFields.YEAR year)
Sets the year of this ExplicitDate object to the given value.

Parameters:
year - - the year to be set for this object.

getMonth

public RecurrenceFields.MONTH_OF_YEAR getMonth()
Returns the month part of this ExplicitDate object.

Returns:
- the month represented by this object.

setMonth

public void setMonth(RecurrenceFields.MONTH_OF_YEAR month)
Sets the month of this ExplicitDate object to the given value.

Parameters:
month - - the month to be set for this object.

getDay

public RecurrenceFields.DAY_OF_MONTH getDay()
Returns the day part of this ExplicitDate object.

Returns:
- the day represented by this object.

setDay

public void setDay(RecurrenceFields.DAY_OF_MONTH day)
Sets the day of this ExplicitDate object to the given value.

Parameters:
day - - the day to be set for this object.

getTime

public RecurrenceFields.TIME_OF_DAY getTime()
Returns the time part of this ExplicitDate object.

Returns:
- the time represented by this object.

setTime

public void setTime(RecurrenceFields.TIME_OF_DAY time)
Sets the time of this ExplicitDate object to the given value.

Parameters:
time - - the time to be set for this object.

equals

public boolean equals(java.lang.Object obj)
Compares an object for equality with this ExplicitDate object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - - the object to compare with this ExplicitDate.
Returns:
- true if the object passed in is an instance of ExplicitDate and is equal to this ExplicitDate, false otherwise.

hashCode

public int hashCode()
Returns the hash code value of this ExplicitDate object.

Overrides:
hashCode in class java.lang.Object
Returns:
- the hash code value of this ExplicitDate object.

Oracle Fusion Applications Java API Reference for Oracle Enterprise Scheduler Service
11g Release 1 (11.1.1.5)
E20742-01


Copyright © 2008, 2011 Oracle. All rights reserved.