PenProfile 2.x

com.sun.cldc.util.j2me
Class TimeZoneImpl

java.lang.Object
  extended by java.util.TimeZone
      extended by com.sun.cldc.util.j2me.TimeZoneImpl

public class TimeZoneImpl
extends TimeZone

This class provides the time zone implementations for J2ME CLDC/MIDP. By default, the only supported time zone is UTC/GMT. Vendor-specific implementations may provide additional time zones.

See Also:
TimeZone

Constructor Summary
TimeZoneImpl()
           
 
Method Summary
 String getID()
          Gets the ID of this time zone.
 String[] getIDs()
          Gets all the available IDs supported.
 TimeZone getInstance(String ID)
          Gets the TimeZone for the given ID.
 int getOffset(int era, int year, int month, int day, int dayOfWeek, int millis)
          Gets offset, for current date, modified in case of daylight savings.
 int getRawOffset()
          Gets the GMT offset for this time zone.
 boolean useDaylightTime()
          Queries if this time zone uses Daylight Savings Time.
 
Methods inherited from class java.util.TimeZone
getAvailableIDs, getDefault, getTimeZone
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeZoneImpl

public TimeZoneImpl()
Method Detail

getOffset

public int getOffset(int era,
                     int year,
                     int month,
                     int day,
                     int dayOfWeek,
                     int millis)
Gets offset, for current date, modified in case of daylight savings. This is the offset to add *to* GMT to get local time. Gets the time zone offset, for current date, modified in case of daylight savings. This is the offset to add *to* GMT to get local time. Assume that the start and end month are distinct. This method may return incorrect results for rules that start at the end of February (e.g., last Sunday in February) or the beginning of March (e.g., March 1).

Specified by:
getOffset in class TimeZone
Parameters:
era - The era of the given date (0 = BC, 1 = AD).
year - The year in the given date.
month - The month in the given date. Month is 0-based. e.g., 0 for January.
day - The day-in-month of the given date.
dayOfWeek - The day-of-week of the given date.
millis - The milliseconds in day in standard local time.
Returns:
The offset to add *to* GMT to get local time.
Throws:
IllegalArgumentException - the era, month, day, dayOfWeek, or millis parameters are out of range

getRawOffset

public int getRawOffset()
Gets the GMT offset for this time zone.

Specified by:
getRawOffset in class TimeZone
Returns:
the GMT offset for this time zone.

useDaylightTime

public boolean useDaylightTime()
Queries if this time zone uses Daylight Savings Time.

Specified by:
useDaylightTime in class TimeZone
Returns:
if this time zone uses Daylight Savings Time.

getID

public String getID()
Gets the ID of this time zone.

Overrides:
getID in class TimeZone
Returns:
the ID of this time zone.

getInstance

public TimeZone getInstance(String ID)
Gets the TimeZone for the given ID.

Parameters:
ID - the ID for a TimeZone, either an abbreviation such as "GMT", or a full name such as "America/Los_Angeles".

The only time zone ID that is required to be supported is "GMT", though typically, the timezones for the regions where the device is sold should be supported.

Returns:
the specified TimeZone, or null if the given ID cannot be understood.

getIDs

public String[] getIDs()
Gets all the available IDs supported.

Returns:
an array of IDs.

PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.