Class TZInfo
java.lang.Object
org.deltava.beans.TZInfo
- All Implemented Interfaces:
Serializable,Comparable<TZInfo>,ComboAlias,ViewEntry
public class TZInfo
extends Object
implements Serializable, ComboAlias, Comparable<TZInfo>, ViewEntry
A class for dealing with Time Zones.
- Since:
- 1.0
- Version:
- 11.0
- Author:
- Luke
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintCompares this Time Zone to another object by comparing the UTC offset.booleanstatic TZInfoGets a Time Zone wrapper using the standard Java Time Zone name.getAbbr()Returns the abbreviation of this Time Zone.static Collection<TZInfo> getAll()Returns all initialized Time Zones.Returns the alias to use in the HTML <OPTION> element.Returns the visible name to use in the HTML <OPTION> element.getID()Returns the JVM ID of the underlying Java TimeZone object.getName()Returns this Time Zone's name.Returns the CSS class for this object if rendered in a view table.getZone()Returns the underlying Java TimeZone object.booleanhasDST()Returns if this time zone observers Daylight Savings time at some point in the future.inthashCode()static TZInfoCreates a Time Zone Wrapper with user-provided name and abbreviation.protected static voidreset()Resets the list of time zones.toString()Converts this time zone into a String.
-
Field Details
-
UTC
Time Zone for GMT/UTC.
-
-
Method Details
-
init
Creates a Time Zone Wrapper with user-provided name and abbreviation.- Parameters:
tzName- A standard Java Time Zone IDdisplayName- If not null, the name to display instead of the JVM nameabbr- An abbreviation for this time zone- Returns:
- the TZInfo instance created
- See Also:
-
get
-
getComboAlias
Description copied from interface:ComboAliasReturns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAliasin interfaceComboAlias- Returns:
- The alias for this entry
-
getComboName
Description copied from interface:ComboAliasReturns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboNamein interfaceComboAlias- Returns:
- The visible name for this entry
-
getAll
Returns all initialized Time Zones.- Returns:
- a sorted Set of TZInfo objects
-
getZone
-
getID
Returns the JVM ID of the underlying Java TimeZone object.- Returns:
- The Java TimeZone ID
- See Also:
-
getAbbr
Returns the abbreviation of this Time Zone.- Returns:
- The user-supplied abbreviation, or null if none provided
-
getName
Returns this Time Zone's name.- Returns:
- The name of the time zone; if no user-supplied name is present then use the Java name
-
hasDST
public boolean hasDST()Returns if this time zone observers Daylight Savings time at some point in the future.- Returns:
- TRUE if DST starts or ends at some future date, otherwise FALSE
-
toString
-
compareTo
Compares this Time Zone to another object by comparing the UTC offset.- Specified by:
compareToin interfaceComparable<TZInfo>- Parameters:
tz2- the TimeZone entry to compare to
-
equals
-
hashCode
-
reset
protected static void reset()Resets the list of time zones. For unit testing only. -
getRowClassName
Description copied from interface:ViewEntryReturns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassNamein interfaceViewEntry- Returns:
- the CSS class name, or NULL if none
-