Package com.ibm.icu.text.TimeZoneFormat

Examples of com.ibm.icu.text.TimeZoneFormat.Style


      cal.set(Calendar.HOUR, value);
      return pos.getIndex();
    case 17: // 'z' - ZONE_OFFSET
    {
      Output<TimeType> tzTimeType = new Output<TimeType>();
      Style style = (count < 4) ? Style.SPECIFIC_SHORT : Style.SPECIFIC_LONG;
      TimeZone tz = tzFormat().parse(style, text, pos, tzTimeType);
      if (tz != null) {
        tztype = tzTimeType.value;
        cal.setTimeZone(tz);
        return pos.getIndex();
      }
      return -start;
    }
    case 23: // 'Z' - TIMEZONE_RFC
    {
      Output<TimeType> tzTimeType = new Output<TimeType>();
      Style style = (count < 4) ? Style.ISO_BASIC_LOCAL_FULL : ((count == 5) ? Style.ISO_EXTENDED_FULL : Style.LOCALIZED_GMT);
      TimeZone tz = tzFormat().parse(style, text, pos, tzTimeType);
      if (tz != null) {
        tztype = tzTimeType.value;
        cal.setTimeZone(tz);
        return pos.getIndex();
      }
      return -start;
    }
    case 24: // 'v' - TIMEZONE_GENERIC
    {
      Output<TimeType> tzTimeType = new Output<TimeType>();
      // Note: 'v' only supports count 1 and 4
      Style style = (count < 4) ? Style.GENERIC_SHORT : Style.GENERIC_LONG;
      TimeZone tz = tzFormat().parse(style, text, pos, tzTimeType);
      if (tz != null) {
        tztype = tzTimeType.value;
        cal.setTimeZone(tz);
        return pos.getIndex();
      }
      return -start;
    }
    case 29: // 'V' - TIMEZONE_SPECIAL
    {
      Output<TimeType> tzTimeType = new Output<TimeType>();
      Style style = null;
      switch (count) {
      case 1:
        style = Style.ZONE_ID_SHORT;
        break;
      case 2:
        style = Style.ZONE_ID;
        break;
      case 3:
        style = Style.EXEMPLAR_LOCATION;
        break;
      default:
        style = Style.GENERIC_LOCATION;
        break;
      }
      TimeZone tz = tzFormat().parse(style, text, pos, tzTimeType);
      if (tz != null) {
        tztype = tzTimeType.value;
        cal.setTimeZone(tz);
        return pos.getIndex();
      }
      return -start;
    }
    case 31: // 'O' - TIMEZONE_LOCALIZED_GMT_OFFSET
    {
      Output<TimeType> tzTimeType = new Output<TimeType>();
      Style style = (count < 4) ? Style.LOCALIZED_GMT_SHORT : Style.LOCALIZED_GMT;
      TimeZone tz = tzFormat().parse(style, text, pos, tzTimeType);
      if (tz != null) {
        tztype = tzTimeType.value;
        cal.setTimeZone(tz);
        return pos.getIndex();
      }
      return -start;
    }
    case 32: // 'X' - TIMEZONE_ISO
    {
      Output<TimeType> tzTimeType = new Output<TimeType>();
      Style style;
      switch (count) {
      case 1:
        style = Style.ISO_BASIC_SHORT;
        break;
      case 2:
        style = Style.ISO_BASIC_FIXED;
        break;
      case 3:
        style = Style.ISO_EXTENDED_FIXED;
        break;
      case 4:
        style = Style.ISO_BASIC_FULL;
        break;
      default: // count >= 5
        style = Style.ISO_EXTENDED_FULL;
        break;
      }
      TimeZone tz = tzFormat().parse(style, text, pos, tzTimeType);
      if (tz != null) {
        tztype = tzTimeType.value;
        cal.setTimeZone(tz);
        return pos.getIndex();
      }
      return -start;
    }
    case 33: // 'x' - TIMEZONE_ISO_LOCAL
    {
      Output<TimeType> tzTimeType = new Output<TimeType>();
      Style style;
      switch (count) {
      case 1:
        style = Style.ISO_BASIC_LOCAL_SHORT;
        break;
      case 2:
View Full Code Here

TOP

Related Classes of com.ibm.icu.text.TimeZoneFormat.Style

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.