gpt4 book ai didi

libcore.util.ZoneInfoDB类的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 18:17:31 27 4
gpt4 key购买 nike

本文整理了Java中libcore.util.ZoneInfoDB类的一些代码示例,展示了ZoneInfoDB类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneInfoDB类的具体详情如下:
包路径:libcore.util.ZoneInfoDB
类名称:ZoneInfoDB

ZoneInfoDB介绍

[英]A class used to initialize the time zone database. This implementation uses the Olson tzdata as the source of time zone information. However, to conserve disk space (inodes) and reduce I/O, all the data is concatenated into a single file, with an index to indicate the starting position of each time zone record.
[中]用于初始化时区数据库的类。这个实现使用奥尔森数据作为时区信息的来源。然而,为了节省磁盘空间(inodes)和减少I/O,所有数据都连接到一个文件中,并带有一个索引来指示每个时区记录的起始位置。

代码示例

代码示例来源:origin: robovm/robovm

/**
 * Returns the system's installed time zone IDs. Any of these IDs can be
 * passed to {@link #getTimeZone} to lookup the corresponding time zone
 * instance.
 */
public static synchronized String[] getAvailableIDs() {
  return ZoneInfoDB.getInstance().getAvailableIDs();
}

代码示例来源:origin: robovm/robovm

/**
 * Returns the IDs of the time zones whose offset from UTC is {@code
 * offsetMillis}. Any of these IDs can be passed to {@link #getTimeZone} to
 * lookup the corresponding time zone instance.
 *
 * @return a possibly-empty array.
 */
public static synchronized String[] getAvailableIDs(int offsetMillis) {
  return ZoneInfoDB.getInstance().getAvailableIDs(offsetMillis);
}

代码示例来源:origin: robovm/robovm

/**
 * Returns an array containing the time zone ids in use in the country corresponding to
 * the given locale. This is not necessary for Java API, but is used by telephony as a
 * fallback. We retrieve these strings from zone.tab rather than icu4c because the latter
 * supplies them in alphabetical order where zone.tab has them in a kind of "importance"
 * order (as defined in the zone.tab header).
 */
public static String[] forLocale(Locale locale) {
  String countryCode = locale.getCountry();
  ArrayList<String> ids = new ArrayList<String>();
  for (String line : ZoneInfoDB.getInstance().getZoneTab().split("\n")) {
    if (line.startsWith(countryCode)) {
      int olsonIdStart = line.indexOf('\t', 4) + 1;
      int olsonIdEnd = line.indexOf('\t', olsonIdStart);
      if (olsonIdEnd == -1) {
        olsonIdEnd = line.length(); // Not all zone.tab lines have a comment.
      }
      ids.add(line.substring(olsonIdStart, olsonIdEnd));
    }
  }
  return ids.toArray(new String[ids.size()]);
}

代码示例来源:origin: robovm/robovm

zoneName = ZoneInfoDB.getInstance().getDefaultID();

代码示例来源:origin: robovm/robovm

zone = ZoneInfoDB.getInstance().makeTimeZone(id);
} catch (IOException ignored) {

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the IDs of the time zones whose offset from UTC is {@code
 * offsetMillis}. Any of these IDs can be passed to {@link #getTimeZone} to
 * lookup the corresponding time zone instance.
 *
 * @return a possibly-empty array.
 */
public static synchronized String[] getAvailableIDs(int offsetMillis) {
  return ZoneInfoDB.getInstance().getAvailableIDs(offsetMillis);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the system's installed time zone IDs. Any of these IDs can be
 * passed to {@link #getTimeZone} to lookup the corresponding time zone
 * instance.
 */
public static synchronized String[] getAvailableIDs() {
  return ZoneInfoDB.getInstance().getAvailableIDs();
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns the IDs of the time zones whose offset from UTC is {@code
 * offsetMillis}. Any of these IDs can be passed to {@link #getTimeZone} to
 * lookup the corresponding time zone instance.
 *
 * @return a possibly-empty array.
 */
public static synchronized String[] getAvailableIDs(int offsetMillis) {
  return ZoneInfoDB.getInstance().getAvailableIDs(offsetMillis);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns the IDs of the time zones whose offset from UTC is {@code
 * offsetMillis}. Any of these IDs can be passed to {@link #getTimeZone} to
 * lookup the corresponding time zone instance.
 *
 * @return a possibly-empty array.
 */
public static synchronized String[] getAvailableIDs(int offsetMillis) {
  return ZoneInfoDB.getInstance().getAvailableIDs(offsetMillis);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Returns the system's installed time zone IDs. Any of these IDs can be
 * passed to {@link #getTimeZone} to lookup the corresponding time zone
 * instance.
 */
public static synchronized String[] getAvailableIDs() {
  return ZoneInfoDB.getInstance().getAvailableIDs();
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns the system's installed time zone IDs. Any of these IDs can be
 * passed to {@link #getTimeZone} to lookup the corresponding time zone
 * instance.
 */
public static synchronized String[] getAvailableIDs() {
  return ZoneInfoDB.getInstance().getAvailableIDs();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns the system's installed time zone IDs. Any of these IDs can be
 * passed to {@link #getTimeZone} to lookup the corresponding time zone
 * instance.
 */
public static synchronized String[] getAvailableIDs() {
  return ZoneInfoDB.getInstance().getAvailableIDs();
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Returns the IDs of the time zones whose offset from UTC is {@code
 * offsetMillis}. Any of these IDs can be passed to {@link #getTimeZone} to
 * lookup the corresponding time zone instance.
 *
 * @return a possibly-empty array.
 */
public static synchronized String[] getAvailableIDs(int offsetMillis) {
  return ZoneInfoDB.getInstance().getAvailableIDs(offsetMillis);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns the system's installed time zone IDs. Any of these IDs can be
 * passed to {@link #getTimeZone} to lookup the corresponding time zone
 * instance.
 */
public static synchronized String[] getAvailableIDs() {
  return ZoneInfoDB.getInstance().getAvailableIDs();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns the system's installed time zone IDs. Any of these IDs can be
 * passed to {@link #getTimeZone} to lookup the corresponding time zone
 * instance.
 */
public static synchronized String[] getAvailableIDs() {
  return ZoneInfoDB.getInstance().getAvailableIDs();
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Returns the IDs of the time zones whose offset from UTC is {@code
 * offsetMillis}. Any of these IDs can be passed to {@link #getTimeZone} to
 * lookup the corresponding time zone instance.
 *
 * @return a possibly-empty array.
 */
public static synchronized String[] getAvailableIDs(int offsetMillis) {
  return ZoneInfoDB.getInstance().getAvailableIDs(offsetMillis);
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Returns the IDs of the time zones whose offset from UTC is {@code
 * offsetMillis}. Any of these IDs can be passed to {@link #getTimeZone} to
 * lookup the corresponding time zone instance.
 *
 * @return a possibly-empty array.
 */
public static synchronized String[] getAvailableIDs(int offsetMillis) {
  return ZoneInfoDB.getInstance().getAvailableIDs(offsetMillis);
}

代码示例来源:origin: ibinti/bugvm

/**
 * Returns an array containing the time zone ids in use in the country corresponding to
 * the given locale. This is not necessary for Java API, but is used by telephony as a
 * fallback. We retrieve these strings from zone.tab rather than icu4c because the latter
 * supplies them in alphabetical order where zone.tab has them in a kind of "importance"
 * order (as defined in the zone.tab header).
 */
public static String[] forLocale(Locale locale) {
  String countryCode = locale.getCountry();
  ArrayList<String> ids = new ArrayList<String>();
  for (String line : ZoneInfoDB.getInstance().getZoneTab().split("\n")) {
    if (line.startsWith(countryCode)) {
      int olsonIdStart = line.indexOf('\t', 4) + 1;
      int olsonIdEnd = line.indexOf('\t', olsonIdStart);
      if (olsonIdEnd == -1) {
        olsonIdEnd = line.length(); // Not all zone.tab lines have a comment.
      }
      ids.add(line.substring(olsonIdStart, olsonIdEnd));
    }
  }
  return ids.toArray(new String[ids.size()]);
}

代码示例来源:origin: MobiVM/robovm

/**
 * Returns an array containing the time zone ids in use in the country corresponding to
 * the given locale. This is not necessary for Java API, but is used by telephony as a
 * fallback. We retrieve these strings from zone.tab rather than icu4c because the latter
 * supplies them in alphabetical order where zone.tab has them in a kind of "importance"
 * order (as defined in the zone.tab header).
 */
public static String[] forLocale(Locale locale) {
  String countryCode = locale.getCountry();
  ArrayList<String> ids = new ArrayList<String>();
  for (String line : ZoneInfoDB.getInstance().getZoneTab().split("\n")) {
    if (line.startsWith(countryCode)) {
      int olsonIdStart = line.indexOf('\t', 4) + 1;
      int olsonIdEnd = line.indexOf('\t', olsonIdStart);
      if (olsonIdEnd == -1) {
        olsonIdEnd = line.length(); // Not all zone.tab lines have a comment.
      }
      ids.add(line.substring(olsonIdStart, olsonIdEnd));
    }
  }
  return ids.toArray(new String[ids.size()]);
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Returns an array containing the time zone ids in use in the country corresponding to
 * the given locale. This is not necessary for Java API, but is used by telephony as a
 * fallback. We retrieve these strings from zone.tab rather than icu4c because the latter
 * supplies them in alphabetical order where zone.tab has them in a kind of "importance"
 * order (as defined in the zone.tab header).
 */
public static String[] forLocale(Locale locale) {
  String countryCode = locale.getCountry();
  ArrayList<String> ids = new ArrayList<String>();
  for (String line : ZoneInfoDB.getInstance().getZoneTab().split("\n")) {
    if (line.startsWith(countryCode)) {
      int olsonIdStart = line.indexOf('\t', 4) + 1;
      int olsonIdEnd = line.indexOf('\t', olsonIdStart);
      if (olsonIdEnd == -1) {
        olsonIdEnd = line.length(); // Not all zone.tab lines have a comment.
      }
      ids.add(line.substring(olsonIdStart, olsonIdEnd));
    }
  }
  return ids.toArray(new String[ids.size()]);
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com