net.rim.device.api.util
Class TimeZoneUtilities

java.lang.Object
  extended by net.rim.device.api.util.TimeZoneUtilities

public class TimeZoneUtilities
extends Object

This class provides utility methods for the time zones supported by the BlackBerry smartphone.

Since:
BlackBerry API 4.6.0

Field Summary
static int LONG
          A style specifier for long display names, which typically require an entire screen width to display properly.
static int SHORT
          A style specifier for short display names, which are suitable for use in a selection UI widget such as a ChoiceField.
 
Method Summary
static TimeZone[] getAvailableTimeZones()
          Returns an array of all available time zones, in order by GMT offset.
static String getDisplayName(TimeZone timeZone, int style)
          Returns the display name of the specified time zone in the specified style, localized according to the current locale.
static String[] getDisplayNames(int style)
          Returns the display names of all available time zones, in order by GMT offset, in the specified style, and localized according to the current locale.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

SHORT

public static final int SHORT
A style specifier for short display names, which are suitable for use in a selection UI widget such as a ChoiceField.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0

LONG

public static final int LONG
A style specifier for long display names, which typically require an entire screen width to display properly.

See Also:
Constant Field Values
Since:
BlackBerry API 4.6.0


Method Detail

getAvailableTimeZones

public static TimeZone[] getAvailableTimeZones()
Returns an array of all available time zones, in order by GMT offset.

Returns:
An array of all available time zones.
Since:
BlackBerry API 4.6.0

getDisplayName

public static String getDisplayName(TimeZone timeZone,
                                    int style)
Returns the display name of the specified time zone in the specified style, localized according to the current locale.

Parameters:
timeZone - The time zone whose display name is being retrieved.
style - Either LONG or SHORT.
Returns:
The display name.
Throws:
NullPointerException - if timeZone is null.
IllegalArgumentException - if timeZone is not a supported time zone, or style is not LONG or SHORT.
Since:
BlackBerry API 4.6.0

getDisplayNames

public static String[] getDisplayNames(int style)
Returns the display names of all available time zones, in order by GMT offset, in the specified style, and localized according to the current locale.

Parameters:
style - Either LONG or SHORT.
Returns:
The display names.
Throws:
IllegalArgumentException - if style is not LONG or SHORT.
Since:
BlackBerry API 4.6.0





Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal