當前位置: 首頁>>代碼示例>>Java>>正文


Java TimeZoneImplementation類代碼示例

本文整理匯總了Java中com.sun.cldc.util.TimeZoneImplementation的典型用法代碼示例。如果您正苦於以下問題:Java TimeZoneImplementation類的具體用法?Java TimeZoneImplementation怎麽用?Java TimeZoneImplementation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TimeZoneImplementation類屬於com.sun.cldc.util包,在下文中一共展示了TimeZoneImplementation類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTimeZone

import com.sun.cldc.util.TimeZoneImplementation; //導入依賴的package包/類
/**
 * Gets the <code>TimeZone</code> for the given ID.
 * @param ID the ID for a <code>TimeZone</code>, either an abbreviation such as
 * "GMT", or a full name such as "America/Los_Angeles".
 * <p> The only time zone ID that is required to be supported is "GMT".
 *
 * @return the specified TimeZone, or the GMT zone if the given ID cannot be
 * understood.
 */
public static synchronized TimeZone getTimeZone(String ID) {
    if (ID == null) {
        throw new NullPointerException();
    }
    getDefault();
    TimeZone tz = ((TimeZoneImplementation)defaultZone).getInstance(ID);
    if (tz == null) {
        tz = ((TimeZoneImplementation)defaultZone).getInstance("GMT");
    }
    return tz;
}
 
開發者ID:tomatsu,項目名稱:squawk,代碼行數:21,代碼來源:TimeZone.java

示例2: getDefault

import com.sun.cldc.util.TimeZoneImplementation; //導入依賴的package包/類
/**
     * Gets the default <code>TimeZone</code> for this host.
     * The source of the default <code>TimeZone</code>
     * may vary with implementation.
     * @return a default <code>TimeZone</code>.
     */

    /* <p>
     * The following is information for implementers. Applications
     * should not need to be aware of this or rely on it, because 
     * each implementation may do it differently:
     * <p>
     * The TimeZone class will look up a time zone implementation
     * class at runtime. The class name will take the form:
     * <p>
     * <code>{classRoot}.util.{platform}.TimeZoneImpl</code>
     * <p>
     * To simplify things, we use a hard-coded path name here.
     * Actual location of the implementation class may vary 
     * from one implementation to another.
     */
    public static synchronized TimeZone getDefault() {
        if ( defaultZone == null ) {
            try {
/*if[GMT_ONLY]*/
                defaultZone = new com.sun.cldc.util.j2me.GMTImpl();
/*else[GMT_ONLY]*/
//              defaultZone = new com.sun.cldc.util.j2me.TimeZoneImpl();
/*end[GMT_ONLY]*/
                // Construct a new TimeZoneImplementation instance
                defaultZone = ((TimeZoneImplementation)defaultZone).getInstance(null);
            }
            catch (Exception x) {}
        }
        return defaultZone;
    }
 
開發者ID:tomatsu,項目名稱:squawk,代碼行數:37,代碼來源:TimeZone.java

示例3: getAvailableIDs

import com.sun.cldc.util.TimeZoneImplementation; //導入依賴的package包/類
/** 
 * Gets all the available IDs supported.
 * @return  an array of IDs.
 */
public static String[] getAvailableIDs() {
    getDefault();
    return ((TimeZoneImplementation)defaultZone).getIDs();
}
 
開發者ID:tomatsu,項目名稱:squawk,代碼行數:9,代碼來源:TimeZone.java


注:本文中的com.sun.cldc.util.TimeZoneImplementation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。