com.sas.util
Class CurrentTime

com.sas.util.CurrentTime
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 CurrentTime
implements com.sas.util.TimeIntervals

CurrentTime is a text model that updates itself with the current time. The default update interval is one second.

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
CurrentTime()
          Default constructor.
CurrentTime(java.text.DateFormat timeFormat)
          Custom constructor for non-Locale default time format.
CurrentTime(java.text.DateFormat timeFormat, java.util.Calendar calendar)
          Deprecated. the calendar parameter is no longer used. Use CurrentTime(DateFormat timeFormat)
CurrentTime(long interval)
          Custom constructor for default date format.
CurrentTime(long interval, int format)
          Custom constructor for default date format
CurrentTime(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()
           
 
Methods inherited from class com.sas.util.DateTimeMonitor
fireAlarm, getDateTime, getFormat, getInterval, 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

CurrentTime

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


CurrentTime

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

Custom constructor for non-Locale default time format.

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

CurrentTime

public CurrentTime(java.text.DateFormat timeFormat)
Custom constructor for non-Locale default time format.

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

CurrentTime

public CurrentTime(long interval)
Custom constructor for default date format.

Parameters:
interval - how often you want the time updated; for example, TimeIntervals.ONE_SECOND, TimeIntervals.ONE_MINUTE, etc.
See Also:
DateFormat

CurrentTime

public CurrentTime(long interval,
                   int format)
Custom constructor for default date format

Parameters:
interval - how often you want the time updated; for example, TimeIntervals.ONE_SECOND, TimeIntervals.ONE_MINUTE, etc.
format - one of DateFormat.SHORT, DateFormat.MEDIUM, DateFormat.LONG, or DateFormat.FULL

CurrentTime

public CurrentTime(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()

getDelay

protected long getDelay()
Override the delay until the alarm should fire. For a CurrentTime, this is simply 0 -- start monitoring immediately.

Overrides:
getDelay in class DateTimeMonitor
Returns:
the delay before first firing the alarm.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.