Java 类java.text.spi.DateFormatProvider 实例源码

项目:OpenJSharp    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:jdk8u-jdk    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:openjdk-jdk10    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:openjdk-jdk10    文件:JRELocaleProviderAdapter.java   
@Override
public DateFormatProvider getDateFormatProvider() {
    if (dateFormatProvider == null) {
        DateFormatProvider provider = AccessController.doPrivileged(
            (PrivilegedAction<DateFormatProvider>) () ->
                new DateFormatProviderImpl(
                    getAdapterType(),
                    getLanguageTagSet("FormatData")));

        synchronized (this) {
            if (dateFormatProvider == null) {
                dateFormatProvider = provider;
            }
        }
    }
    return dateFormatProvider;
}
项目:openjdk9    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:openjdk9    文件:JRELocaleProviderAdapter.java   
@Override
public DateFormatProvider getDateFormatProvider() {
    if (dateFormatProvider == null) {
        DateFormatProvider provider = AccessController.doPrivileged(
            (PrivilegedAction<DateFormatProvider>) () ->
                new DateFormatProviderImpl(
                    getAdapterType(),
                    getLanguageTagSet("FormatData")));

        synchronized (this) {
            if (dateFormatProvider == null) {
                dateFormatProvider = provider;
            }
        }
    }
    return dateFormatProvider;
}
项目:Java8CN    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:NonDex    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:jdk8u_jdk    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:lookaside_java-1.8.0-openjdk    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:VarJ    文件:DateFormat.java   
public DateFormat getObject(DateFormatProvider dateFormatProvider, 
                              Locale locale, 
                              String key,
                              Object... params) {
          assert params.length == 3;

          int timeStyle = (Integer)params[0];
          int dateStyle = (Integer)params[1];
          int flags = (Integer)params[2];

   switch (flags) {
   case 1:
return dateFormatProvider.getTimeInstance(timeStyle, locale);
   case 2:
return dateFormatProvider.getDateInstance(dateStyle, locale);
   case 3:
return dateFormatProvider.getDateTimeInstance(dateStyle, timeStyle, locale);
   default:
assert false : "should not happen";
   }

          return null;
      }
项目:jdk-1.7-annotated    文件:DateFormat.java   
public DateFormat getObject(DateFormatProvider dateFormatProvider,
                        Locale locale,
                        String key,
                        Object... params) {
    assert params.length == 3;

    int timeStyle = (Integer)params[0];
    int dateStyle = (Integer)params[1];
    int flags = (Integer)params[2];

    switch (flags) {
    case 1:
        return dateFormatProvider.getTimeInstance(timeStyle, locale);
    case 2:
        return dateFormatProvider.getDateInstance(dateStyle, locale);
    case 3:
        return dateFormatProvider.getDateTimeInstance(dateStyle, timeStyle, locale);
    default:
        assert false : "should not happen";
    }

    return null;
}
项目:infobip-open-jdk-8    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:jdk8u-dev-jdk    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:jdk7-jdk    文件:DateFormat.java   
public DateFormat getObject(DateFormatProvider dateFormatProvider,
                        Locale locale,
                        String key,
                        Object... params) {
    assert params.length == 3;

    int timeStyle = (Integer)params[0];
    int dateStyle = (Integer)params[1];
    int flags = (Integer)params[2];

    switch (flags) {
    case 1:
        return dateFormatProvider.getTimeInstance(timeStyle, locale);
    case 2:
        return dateFormatProvider.getDateInstance(dateStyle, locale);
    case 3:
        return dateFormatProvider.getDateTimeInstance(dateStyle, timeStyle, locale);
    default:
        assert false : "should not happen";
    }

    return null;
}
项目:openjdk-source-code-learn    文件:DateFormat.java   
public DateFormat getObject(DateFormatProvider dateFormatProvider,
                        Locale locale,
                        String key,
                        Object... params) {
    assert params.length == 3;

    int timeStyle = (Integer)params[0];
    int dateStyle = (Integer)params[1];
    int flags = (Integer)params[2];

    switch (flags) {
    case 1:
        return dateFormatProvider.getTimeInstance(timeStyle, locale);
    case 2:
        return dateFormatProvider.getDateInstance(dateStyle, locale);
    case 3:
        return dateFormatProvider.getDateTimeInstance(dateStyle, timeStyle, locale);
    default:
        assert false : "should not happen";
    }

    return null;
}
项目:OLD-OpenJDK8    文件:DateFormat.java   
/**
 * Creates a DateFormat with the given time and/or date style in the given
 * locale.
 * @param timeStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 2
 * @param dateStyle a value from 0 to 3 indicating the time format,
 * ignored if flags is 1
 * @param flags either 1 for a time format, 2 for a date format,
 * or 3 for a date/time format
 * @param loc the locale for the format
 */
private static DateFormat get(int timeStyle, int dateStyle,
                              int flags, Locale loc) {
    if ((flags & 1) != 0) {
        if (timeStyle < 0 || timeStyle > 3) {
            throw new IllegalArgumentException("Illegal time style " + timeStyle);
        }
    } else {
        timeStyle = -1;
    }
    if ((flags & 2) != 0) {
        if (dateStyle < 0 || dateStyle > 3) {
            throw new IllegalArgumentException("Illegal date style " + dateStyle);
        }
    } else {
        dateStyle = -1;
    }

    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    DateFormat dateFormat = get(adapter, timeStyle, dateStyle, loc);
    if (dateFormat == null) {
        dateFormat = get(LocaleProviderAdapter.forJRE(), timeStyle, dateStyle, loc);
    }
    return dateFormat;
}
项目:openjdk-jdk7u-jdk    文件:DateFormat.java   
public DateFormat getObject(DateFormatProvider dateFormatProvider,
                        Locale locale,
                        String key,
                        Object... params) {
    assert params.length == 3;

    int timeStyle = (Integer)params[0];
    int dateStyle = (Integer)params[1];
    int flags = (Integer)params[2];

    switch (flags) {
    case 1:
        return dateFormatProvider.getTimeInstance(timeStyle, locale);
    case 2:
        return dateFormatProvider.getDateInstance(dateStyle, locale);
    case 3:
        return dateFormatProvider.getDateTimeInstance(dateStyle, timeStyle, locale);
    default:
        assert false : "should not happen";
    }

    return null;
}
项目:openjdk-icedtea7    文件:DateFormat.java   
public DateFormat getObject(DateFormatProvider dateFormatProvider,
                        Locale locale,
                        String key,
                        Object... params) {
    assert params.length == 3;

    int timeStyle = (Integer)params[0];
    int dateStyle = (Integer)params[1];
    int flags = (Integer)params[2];

    switch (flags) {
    case 1:
        return dateFormatProvider.getTimeInstance(timeStyle, locale);
    case 2:
        return dateFormatProvider.getDateInstance(dateStyle, locale);
    case 3:
        return dateFormatProvider.getDateTimeInstance(dateStyle, timeStyle, locale);
    default:
        assert false : "should not happen";
    }

    return null;
}
项目:OpenJSharp    文件:DateFormat.java   
private static DateFormat get(LocaleProviderAdapter adapter, int timeStyle, int dateStyle, Locale loc) {
    DateFormatProvider provider = adapter.getDateFormatProvider();
    DateFormat dateFormat;
    if (timeStyle == -1) {
        dateFormat = provider.getDateInstance(dateStyle, loc);
    } else {
        if (dateStyle == -1) {
            dateFormat = provider.getTimeInstance(timeStyle, loc);
        } else {
            dateFormat = provider.getDateTimeInstance(dateStyle, timeStyle, loc);
        }
    }
    return dateFormat;
}
项目:OpenJSharp    文件:JRELocaleProviderAdapter.java   
@Override
public DateFormatProvider getDateFormatProvider() {
    if (dateFormatProvider == null) {
        DateFormatProvider provider = new DateFormatProviderImpl(getAdapterType(),
                                                getLanguageTagSet("FormatData"));
        synchronized (this) {
            if (dateFormatProvider == null) {
                dateFormatProvider = provider;
            }
        }
    }
    return dateFormatProvider;
}
项目:OpenJSharp    文件:JSpinner.java   
private static String getDefaultPattern(Locale loc) {
    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    LocaleResources lr = adapter.getLocaleResources(loc);
    if (lr == null) {
        lr = LocaleProviderAdapter.forJRE().getLocaleResources(loc);
    }
    return lr.getDateTimePattern(DateFormat.SHORT, DateFormat.SHORT, null);
}
项目:jdk8u-jdk    文件:DateFormat.java   
private static DateFormat get(LocaleProviderAdapter adapter, int timeStyle, int dateStyle, Locale loc) {
    DateFormatProvider provider = adapter.getDateFormatProvider();
    DateFormat dateFormat;
    if (timeStyle == -1) {
        dateFormat = provider.getDateInstance(dateStyle, loc);
    } else {
        if (dateStyle == -1) {
            dateFormat = provider.getTimeInstance(timeStyle, loc);
        } else {
            dateFormat = provider.getDateTimeInstance(dateStyle, timeStyle, loc);
        }
    }
    return dateFormat;
}
项目:jdk8u-jdk    文件:JRELocaleProviderAdapter.java   
@Override
public DateFormatProvider getDateFormatProvider() {
    if (dateFormatProvider == null) {
        DateFormatProvider provider = new DateFormatProviderImpl(getAdapterType(),
                                                getLanguageTagSet("FormatData"));
        synchronized (this) {
            if (dateFormatProvider == null) {
                dateFormatProvider = provider;
            }
        }
    }
    return dateFormatProvider;
}
项目:jdk8u-jdk    文件:JSpinner.java   
private static String getDefaultPattern(Locale loc) {
    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    LocaleResources lr = adapter.getLocaleResources(loc);
    if (lr == null) {
        lr = LocaleProviderAdapter.forJRE().getLocaleResources(loc);
    }
    return lr.getDateTimePattern(DateFormat.SHORT, DateFormat.SHORT, null);
}
项目:jdk8u-jdk    文件:Bug6989440.java   
public TestThread() {
    int which = count++ % 3;
    switch (which) {
        case 0 : cls = LocaleNameProvider.class; break;
        case 1 : cls = TimeZoneNameProvider.class; break;
        case 2 : cls = DateFormatProvider.class; break;
        default : throw new AssertionError("Should not reach here");
    }
}
项目:openjdk-jdk10    文件:DateFormat.java   
private static DateFormat get(LocaleProviderAdapter adapter, int timeStyle, int dateStyle, Locale loc) {
    DateFormatProvider provider = adapter.getDateFormatProvider();
    DateFormat dateFormat;
    if (timeStyle == -1) {
        dateFormat = provider.getDateInstance(dateStyle, loc);
    } else {
        if (dateStyle == -1) {
            dateFormat = provider.getTimeInstance(timeStyle, loc);
        } else {
            dateFormat = provider.getDateTimeInstance(dateStyle, timeStyle, loc);
        }
    }
    return dateFormat;
}
项目:openjdk-jdk10    文件:JSpinner.java   
private static String getDefaultPattern(Locale loc) {
    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    LocaleResources lr = adapter.getLocaleResources(loc);
    if (lr == null) {
        lr = LocaleProviderAdapter.forJRE().getLocaleResources(loc);
    }
    return lr.getDateTimePattern(DateFormat.SHORT, DateFormat.SHORT, null);
}
项目:openjdk-jdk10    文件:Bug6989440.java   
public TestThread() {
    int which = count++ % 3;
    switch (which) {
        case 0 : cls = LocaleNameProvider.class; break;
        case 1 : cls = TimeZoneNameProvider.class; break;
        case 2 : cls = DateFormatProvider.class; break;
        default : throw new AssertionError("Should not reach here");
    }
}
项目:openjdk9    文件:DateFormat.java   
private static DateFormat get(LocaleProviderAdapter adapter, int timeStyle, int dateStyle, Locale loc) {
    DateFormatProvider provider = adapter.getDateFormatProvider();
    DateFormat dateFormat;
    if (timeStyle == -1) {
        dateFormat = provider.getDateInstance(dateStyle, loc);
    } else {
        if (dateStyle == -1) {
            dateFormat = provider.getTimeInstance(timeStyle, loc);
        } else {
            dateFormat = provider.getDateTimeInstance(dateStyle, timeStyle, loc);
        }
    }
    return dateFormat;
}
项目:openjdk9    文件:JSpinner.java   
private static String getDefaultPattern(Locale loc) {
    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    LocaleResources lr = adapter.getLocaleResources(loc);
    if (lr == null) {
        lr = LocaleProviderAdapter.forJRE().getLocaleResources(loc);
    }
    return lr.getDateTimePattern(DateFormat.SHORT, DateFormat.SHORT, null);
}
项目:openjdk9    文件:Bug6989440.java   
public TestThread() {
    int which = count++ % 3;
    switch (which) {
        case 0 : cls = LocaleNameProvider.class; break;
        case 1 : cls = TimeZoneNameProvider.class; break;
        case 2 : cls = DateFormatProvider.class; break;
        default : throw new AssertionError("Should not reach here");
    }
}
项目:Java8CN    文件:DateFormat.java   
private static DateFormat get(LocaleProviderAdapter adapter, int timeStyle, int dateStyle, Locale loc) {
    DateFormatProvider provider = adapter.getDateFormatProvider();
    DateFormat dateFormat;
    if (timeStyle == -1) {
        dateFormat = provider.getDateInstance(dateStyle, loc);
    } else {
        if (dateStyle == -1) {
            dateFormat = provider.getTimeInstance(timeStyle, loc);
        } else {
            dateFormat = provider.getDateTimeInstance(dateStyle, timeStyle, loc);
        }
    }
    return dateFormat;
}
项目:Java8CN    文件:JSpinner.java   
private static String getDefaultPattern(Locale loc) {
    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    LocaleResources lr = adapter.getLocaleResources(loc);
    if (lr == null) {
        lr = LocaleProviderAdapter.forJRE().getLocaleResources(loc);
    }
    return lr.getDateTimePattern(DateFormat.SHORT, DateFormat.SHORT, null);
}
项目:NonDex    文件:DateFormat.java   
private static DateFormat get(LocaleProviderAdapter adapter, int timeStyle, int dateStyle, Locale loc) {
    DateFormatProvider provider = adapter.getDateFormatProvider();
    DateFormat dateFormat;
    if (timeStyle == -1) {
        dateFormat = provider.getDateInstance(dateStyle, loc);
    } else {
        if (dateStyle == -1) {
            dateFormat = provider.getTimeInstance(timeStyle, loc);
        } else {
            dateFormat = provider.getDateTimeInstance(dateStyle, timeStyle, loc);
        }
    }
    return dateFormat;
}
项目:jdk8u_jdk    文件:DateFormat.java   
private static DateFormat get(LocaleProviderAdapter adapter, int timeStyle, int dateStyle, Locale loc) {
    DateFormatProvider provider = adapter.getDateFormatProvider();
    DateFormat dateFormat;
    if (timeStyle == -1) {
        dateFormat = provider.getDateInstance(dateStyle, loc);
    } else {
        if (dateStyle == -1) {
            dateFormat = provider.getTimeInstance(timeStyle, loc);
        } else {
            dateFormat = provider.getDateTimeInstance(dateStyle, timeStyle, loc);
        }
    }
    return dateFormat;
}
项目:jdk8u_jdk    文件:JRELocaleProviderAdapter.java   
@Override
public DateFormatProvider getDateFormatProvider() {
    if (dateFormatProvider == null) {
        DateFormatProvider provider = new DateFormatProviderImpl(getAdapterType(),
                                                getLanguageTagSet("FormatData"));
        synchronized (this) {
            if (dateFormatProvider == null) {
                dateFormatProvider = provider;
            }
        }
    }
    return dateFormatProvider;
}
项目:jdk8u_jdk    文件:JSpinner.java   
private static String getDefaultPattern(Locale loc) {
    LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class, loc);
    LocaleResources lr = adapter.getLocaleResources(loc);
    if (lr == null) {
        lr = LocaleProviderAdapter.forJRE().getLocaleResources(loc);
    }
    return lr.getDateTimePattern(DateFormat.SHORT, DateFormat.SHORT, null);
}
项目:jdk8u_jdk    文件:Bug6989440.java   
public TestThread() {
    int which = count++ % 3;
    switch (which) {
        case 0 : cls = LocaleNameProvider.class; break;
        case 1 : cls = TimeZoneNameProvider.class; break;
        case 2 : cls = DateFormatProvider.class; break;
        default : throw new AssertionError("Should not reach here");
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:DateFormat.java   
private static DateFormat get(LocaleProviderAdapter adapter, int timeStyle, int dateStyle, Locale loc) {
    DateFormatProvider provider = adapter.getDateFormatProvider();
    DateFormat dateFormat;
    if (timeStyle == -1) {
        dateFormat = provider.getDateInstance(dateStyle, loc);
    } else {
        if (dateStyle == -1) {
            dateFormat = provider.getTimeInstance(timeStyle, loc);
        } else {
            dateFormat = provider.getDateTimeInstance(dateStyle, timeStyle, loc);
        }
    }
    return dateFormat;
}