com.sas.util
Class CurrentDate

com.sas.util.CurrentDate
All Implemented Interfaces:
com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.ComponentInterface, com.sas.lang.ObjectDataInterface, com.sas.lang.StringDataInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, com.sas.PublicClonable, AlarmListener, com.sas.util.TimeIntervals, com.sas.ViewInterface, MultipleValueEventSourceInterface, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class CurrentDate
implements com.sas.util.TimeIntervals

CurrentDate is a text model that updates itself with the current date. The default update interval is one day.

See Also:
Serialized Form

Field Summary
static java.lang.String RB_KEY
           
 
Fields inherited from class com.sas.util.DateTimeMonitor
alarm, date, dateTimeFormat, defaultTimeZone
 
Fields inherited from interface com.sas.util.TimeIntervals
ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_SECOND, ONE_WEEK
 
Constructor Summary
CurrentDate()
          Default constructor.
CurrentDate(java.text.DateFormat dateFormat)
          Custom constructor for non-Locale default date format and calendar.
CurrentDate(java.text.DateFormat dateFormat, java.util.Calendar calendar)
          Deprecated. the calendar parameter is no longer used. Use CurrentDate(DateFormat dateFormat)
CurrentDate(int format)
          Custom constructor for default date format
CurrentDate(java.lang.String format)
          Custom constructor for default date format
 
Method Summary
protected  long getDelay()
          Override the delay until the alarm should fire.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
           
 long getInterval()
          Return the interval at which the monitor updates the date/time and text properties.
static long millisUntilMidnight(java.util.Calendar calendar)
          Compute the number of milliseconds remaining until midnight, based on a Calendar object.
 
Methods inherited from class com.sas.util.DateTimeMonitor
fireAlarm, getDateTime, getFormat, isAlarmRunning, newAlarm, setFormat, setInterval, start, stop, update, validateObject
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values
Constructor Detail

CurrentDate

public CurrentDate()
Default constructor. Create a CurrentDate object which updates it's text attribute when the date changes, using the default Locale specific date format.


CurrentDate

public CurrentDate(java.text.DateFormat dateFormat,
                   java.util.Calendar calendar)
Deprecated. the calendar parameter is no longer used. Use CurrentDate(DateFormat dateFormat)

Custom constructor for non-Locale default date format.

Parameters:
dateFormat - a date format with which the date is rendered.
calendar - a calendar with which time values are obtained

CurrentDate

public CurrentDate(java.text.DateFormat dateFormat)
Custom constructor for non-Locale default date format and calendar.

Parameters:
dateFormat - a date format with which the date is rendered.

CurrentDate

public CurrentDate(int format)
Custom constructor for default date format

Parameters:
format - one of DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, or DateFormat.FULL

CurrentDate

public CurrentDate(java.lang.String format)
Custom constructor for default date format

Parameters:
format - A format string used to construct a SimpleDateFormat object which is used to format the date and time. The default time zone is used.
Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()

millisUntilMidnight

public static long millisUntilMidnight(java.util.Calendar calendar)
Compute the number of milliseconds remaining until midnight, based on a Calendar object.

Parameters:
calendar - a Calendar object. If null, the default calendar is used.

getDelay

protected long getDelay()
Override the delay until the alarm should fire. For a CurrentDate, it is the time until the next day (time until midnight)

Overrides:
getDelay in class DateTimeMonitor
Returns:
the delay until this CurrentDate should update

getInterval

public long getInterval()
Return the interval at which the monitor updates the date/time and text properties. This is normally TimeIntervals.ONE_DAY

Overrides:
getInterval in class DateTimeMonitor
Returns:
the update interval.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.