Java 类java.util.spi.CalendarDataProvider 实例源码

项目:OpenJSharp    文件:CalendarDataUtility.java   
@Override
public Integer getObject(CalendarDataProvider calendarDataProvider,
                         Locale locale,
                         String requestID,    // resource key
                         Object... params) {
    assert params.length == 0;
    int value;
    switch (requestID) {
    case FIRST_DAY_OF_WEEK:
        value = calendarDataProvider.getFirstDayOfWeek(locale);
        break;
    case MINIMAL_DAYS_IN_FIRST_WEEK:
        value = calendarDataProvider.getMinimalDaysInFirstWeek(locale);
        break;
    default:
        throw new InternalError("invalid requestID: " + requestID);
    }
    return (value != 0) ? value : null;
}
项目:jdk8u-jdk    文件:CalendarDataUtility.java   
@Override
public Integer getObject(CalendarDataProvider calendarDataProvider,
                         Locale locale,
                         String requestID,    // resource key
                         Object... params) {
    assert params.length == 0;
    int value;
    switch (requestID) {
    case FIRST_DAY_OF_WEEK:
        value = calendarDataProvider.getFirstDayOfWeek(locale);
        break;
    case MINIMAL_DAYS_IN_FIRST_WEEK:
        value = calendarDataProvider.getMinimalDaysInFirstWeek(locale);
        break;
    default:
        throw new InternalError("invalid requestID: " + requestID);
    }
    return (value != 0) ? value : null;
}
项目:openjdk-jdk10    文件:JRELocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    if (calendarDataProvider == null) {
        CalendarDataProvider provider = AccessController.doPrivileged(
            (PrivilegedAction<CalendarDataProvider>) () ->
                new CalendarDataProviderImpl(
                    getAdapterType(),
                    getLanguageTagSet("CalendarData")));

        synchronized (this) {
            if (calendarDataProvider == null) {
                calendarDataProvider = provider;
            }
        }
    }
    return calendarDataProvider;
}
项目:openjdk-jdk10    文件:CalendarDataUtility.java   
@Override
public Integer getObject(CalendarDataProvider calendarDataProvider,
                         Locale locale,
                         String requestID,    // resource key
                         Object... params) {
    assert params.length == 0;
    int value;
    switch (requestID) {
    case FIRST_DAY_OF_WEEK:
        value = calendarDataProvider.getFirstDayOfWeek(locale);
        break;
    case MINIMAL_DAYS_IN_FIRST_WEEK:
        value = calendarDataProvider.getMinimalDaysInFirstWeek(locale);
        break;
    default:
        throw new InternalError("invalid requestID: " + requestID);
    }
    return (value != 0) ? value : null;
}
项目:openjdk9    文件:JRELocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    if (calendarDataProvider == null) {
        CalendarDataProvider provider = AccessController.doPrivileged(
            (PrivilegedAction<CalendarDataProvider>) () ->
                new CalendarDataProviderImpl(
                    getAdapterType(),
                    getLanguageTagSet("CalendarData")));

        synchronized (this) {
            if (calendarDataProvider == null) {
                calendarDataProvider = provider;
            }
        }
    }
    return calendarDataProvider;
}
项目:openjdk9    文件:CalendarDataUtility.java   
@Override
public Integer getObject(CalendarDataProvider calendarDataProvider,
                         Locale locale,
                         String requestID,    // resource key
                         Object... params) {
    assert params.length == 0;
    int value;
    switch (requestID) {
    case FIRST_DAY_OF_WEEK:
        value = calendarDataProvider.getFirstDayOfWeek(locale);
        break;
    case MINIMAL_DAYS_IN_FIRST_WEEK:
        value = calendarDataProvider.getMinimalDaysInFirstWeek(locale);
        break;
    default:
        throw new InternalError("invalid requestID: " + requestID);
    }
    return (value != 0) ? value : null;
}
项目:jdk8u_jdk    文件:CalendarDataUtility.java   
@Override
public Integer getObject(CalendarDataProvider calendarDataProvider,
                         Locale locale,
                         String requestID,    // resource key
                         Object... params) {
    assert params.length == 0;
    int value;
    switch (requestID) {
    case FIRST_DAY_OF_WEEK:
        value = calendarDataProvider.getFirstDayOfWeek(locale);
        break;
    case MINIMAL_DAYS_IN_FIRST_WEEK:
        value = calendarDataProvider.getMinimalDaysInFirstWeek(locale);
        break;
    default:
        throw new InternalError("invalid requestID: " + requestID);
    }
    return (value != 0) ? value : null;
}
项目:lookaside_java-1.8.0-openjdk    文件:CalendarDataUtility.java   
@Override
public Integer getObject(CalendarDataProvider calendarDataProvider,
                         Locale locale,
                         String requestID,    // resource key
                         Object... params) {
    assert params.length == 0;
    int value;
    switch (requestID) {
    case FIRST_DAY_OF_WEEK:
        value = calendarDataProvider.getFirstDayOfWeek(locale);
        break;
    case MINIMAL_DAYS_IN_FIRST_WEEK:
        value = calendarDataProvider.getMinimalDaysInFirstWeek(locale);
        break;
    default:
        throw new InternalError("invalid requestID: " + requestID);
    }
    return (value != 0) ? value : null;
}
项目:infobip-open-jdk-8    文件:CalendarDataUtility.java   
@Override
public Integer getObject(CalendarDataProvider calendarDataProvider,
                         Locale locale,
                         String requestID,    // resource key
                         Object... params) {
    assert params.length == 0;
    int value;
    switch (requestID) {
    case FIRST_DAY_OF_WEEK:
        value = calendarDataProvider.getFirstDayOfWeek(locale);
        break;
    case MINIMAL_DAYS_IN_FIRST_WEEK:
        value = calendarDataProvider.getMinimalDaysInFirstWeek(locale);
        break;
    default:
        throw new InternalError("invalid requestID: " + requestID);
    }
    return (value != 0) ? value : null;
}
项目:jdk8u-dev-jdk    文件:CalendarDataUtility.java   
@Override
public Integer getObject(CalendarDataProvider calendarDataProvider,
                         Locale locale,
                         String requestID,    // resource key
                         Object... params) {
    assert params.length == 0;
    int value;
    switch (requestID) {
    case FIRST_DAY_OF_WEEK:
        value = calendarDataProvider.getFirstDayOfWeek(locale);
        break;
    case MINIMAL_DAYS_IN_FIRST_WEEK:
        value = calendarDataProvider.getMinimalDaysInFirstWeek(locale);
        break;
    default:
        throw new InternalError("invalid requestID: " + requestID);
    }
    return (value != 0) ? value : null;
}
项目:OLD-OpenJDK8    文件:CalendarDataUtility.java   
@Override
public Integer getObject(CalendarDataProvider calendarDataProvider,
                         Locale locale,
                         String requestID,    // resource key
                         Object... params) {
    assert params.length == 0;
    int value;
    switch (requestID) {
    case FIRST_DAY_OF_WEEK:
        value = calendarDataProvider.getFirstDayOfWeek(locale);
        break;
    case MINIMAL_DAYS_IN_FIRST_WEEK:
        value = calendarDataProvider.getMinimalDaysInFirstWeek(locale);
        break;
    default:
        throw new InternalError("invalid requestID: " + requestID);
    }
    return (value != 0) ? value : null;
}
项目:OpenJSharp    文件:JRELocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    if (calendarDataProvider == null) {
        CalendarDataProvider provider;
        provider = new CalendarDataProviderImpl(getAdapterType(),
                                                getLanguageTagSet("CalendarData"));
        synchronized (this) {
            if (calendarDataProvider == null) {
                calendarDataProvider = provider;
            }
        }
    }
    return calendarDataProvider;
}
项目:OpenJSharp    文件:CalendarDataUtility.java   
public static int retrieveFirstDayOfWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, FIRST_DAY_OF_WEEK);
    return (value != null && (value >= SUNDAY && value <= SATURDAY)) ? value : SUNDAY;
}
项目:OpenJSharp    文件:CalendarDataUtility.java   
public static int retrieveMinimalDaysInFirstWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, MINIMAL_DAYS_IN_FIRST_WEEK);
    return (value != null && (value >= 1 && value <= 7)) ? value : 1;
}
项目:jdk8u-jdk    文件:JRELocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    if (calendarDataProvider == null) {
        CalendarDataProvider provider;
        provider = new CalendarDataProviderImpl(getAdapterType(),
                                                getLanguageTagSet("CalendarData"));
        synchronized (this) {
            if (calendarDataProvider == null) {
                calendarDataProvider = provider;
            }
        }
    }
    return calendarDataProvider;
}
项目:jdk8u-jdk    文件:CalendarDataUtility.java   
public static int retrieveFirstDayOfWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, FIRST_DAY_OF_WEEK);
    return (value != null && (value >= SUNDAY && value <= SATURDAY)) ? value : SUNDAY;
}
项目:jdk8u-jdk    文件:CalendarDataUtility.java   
public static int retrieveMinimalDaysInFirstWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, MINIMAL_DAYS_IN_FIRST_WEEK);
    return (value != null && (value >= 1 && value <= 7)) ? value : 1;
}
项目:openjdk-jdk10    文件:CalendarDataUtility.java   
public static int retrieveFirstDayOfWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, true, FIRST_DAY_OF_WEEK);
    return (value != null && (value >= SUNDAY && value <= SATURDAY)) ? value : SUNDAY;
}
项目:openjdk-jdk10    文件:CalendarDataUtility.java   
public static int retrieveMinimalDaysInFirstWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, true, MINIMAL_DAYS_IN_FIRST_WEEK);
    return (value != null && (value >= 1 && value <= 7)) ? value : 1;
}
项目:openjdk9    文件:CalendarDataUtility.java   
public static int retrieveFirstDayOfWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, true, FIRST_DAY_OF_WEEK);
    return (value != null && (value >= SUNDAY && value <= SATURDAY)) ? value : SUNDAY;
}
项目:openjdk9    文件:CalendarDataUtility.java   
public static int retrieveMinimalDaysInFirstWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, true, MINIMAL_DAYS_IN_FIRST_WEEK);
    return (value != null && (value >= 1 && value <= 7)) ? value : 1;
}
项目:jdk8u_jdk    文件:JRELocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    if (calendarDataProvider == null) {
        CalendarDataProvider provider;
        provider = new CalendarDataProviderImpl(getAdapterType(),
                                                getLanguageTagSet("CalendarData"));
        synchronized (this) {
            if (calendarDataProvider == null) {
                calendarDataProvider = provider;
            }
        }
    }
    return calendarDataProvider;
}
项目:jdk8u_jdk    文件:CalendarDataUtility.java   
public static int retrieveFirstDayOfWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, FIRST_DAY_OF_WEEK);
    return (value != null && (value >= SUNDAY && value <= SATURDAY)) ? value : SUNDAY;
}
项目:jdk8u_jdk    文件:CalendarDataUtility.java   
public static int retrieveMinimalDaysInFirstWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, MINIMAL_DAYS_IN_FIRST_WEEK);
    return (value != null && (value >= 1 && value <= 7)) ? value : 1;
}
项目:lookaside_java-1.8.0-openjdk    文件:JRELocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    if (calendarDataProvider == null) {
        CalendarDataProvider provider;
        provider = new CalendarDataProviderImpl(getAdapterType(),
                                                getLanguageTagSet("CalendarData"));
        synchronized (this) {
            if (calendarDataProvider == null) {
                calendarDataProvider = provider;
            }
        }
    }
    return calendarDataProvider;
}
项目:lookaside_java-1.8.0-openjdk    文件:CalendarDataUtility.java   
public static int retrieveFirstDayOfWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, FIRST_DAY_OF_WEEK);
    return (value != null && (value >= SUNDAY && value <= SATURDAY)) ? value : SUNDAY;
}
项目:lookaside_java-1.8.0-openjdk    文件:CalendarDataUtility.java   
public static int retrieveMinimalDaysInFirstWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, MINIMAL_DAYS_IN_FIRST_WEEK);
    return (value != null && (value >= 1 && value <= 7)) ? value : 1;
}
项目:infobip-open-jdk-8    文件:JRELocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    if (calendarDataProvider == null) {
        CalendarDataProvider provider;
        provider = new CalendarDataProviderImpl(getAdapterType(),
                                                getLanguageTagSet("CalendarData"));
        synchronized (this) {
            if (calendarDataProvider == null) {
                calendarDataProvider = provider;
            }
        }
    }
    return calendarDataProvider;
}
项目:infobip-open-jdk-8    文件:CalendarDataUtility.java   
public static int retrieveFirstDayOfWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, FIRST_DAY_OF_WEEK);
    return (value != null && (value >= SUNDAY && value <= SATURDAY)) ? value : SUNDAY;
}
项目:infobip-open-jdk-8    文件:CalendarDataUtility.java   
public static int retrieveMinimalDaysInFirstWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, MINIMAL_DAYS_IN_FIRST_WEEK);
    return (value != null && (value >= 1 && value <= 7)) ? value : 1;
}
项目:jdk8u-dev-jdk    文件:JRELocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    if (calendarDataProvider == null) {
        CalendarDataProvider provider;
        provider = new CalendarDataProviderImpl(getAdapterType(),
                                                getLanguageTagSet("CalendarData"));
        synchronized (this) {
            if (calendarDataProvider == null) {
                calendarDataProvider = provider;
            }
        }
    }
    return calendarDataProvider;
}
项目:jdk8u-dev-jdk    文件:CalendarDataUtility.java   
public static int retrieveFirstDayOfWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, FIRST_DAY_OF_WEEK);
    return (value != null && (value >= SUNDAY && value <= SATURDAY)) ? value : SUNDAY;
}
项目:jdk8u-dev-jdk    文件:CalendarDataUtility.java   
public static int retrieveMinimalDaysInFirstWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, MINIMAL_DAYS_IN_FIRST_WEEK);
    return (value != null && (value >= 1 && value <= 7)) ? value : 1;
}
项目:OLD-OpenJDK8    文件:JRELocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    if (calendarDataProvider == null) {
        CalendarDataProvider provider;
        provider = new CalendarDataProviderImpl(getAdapterType(),
                                                getLanguageTagSet("CalendarData"));
        synchronized (this) {
            if (calendarDataProvider == null) {
                calendarDataProvider = provider;
            }
        }
    }
    return calendarDataProvider;
}
项目:OLD-OpenJDK8    文件:CalendarDataUtility.java   
public static int retrieveFirstDayOfWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, FIRST_DAY_OF_WEEK);
    return (value != null && (value >= SUNDAY && value <= SATURDAY)) ? value : SUNDAY;
}
项目:OLD-OpenJDK8    文件:CalendarDataUtility.java   
public static int retrieveMinimalDaysInFirstWeek(Locale locale) {
    LocaleServiceProviderPool pool =
            LocaleServiceProviderPool.getPool(CalendarDataProvider.class);
    Integer value = pool.getLocalizedObject(CalendarWeekParameterGetter.INSTANCE,
                                            locale, MINIMAL_DAYS_IN_FIRST_WEEK);
    return (value != null && (value >= 1 && value <= 7)) ? value : 1;
}
项目:OpenJSharp    文件:AuxLocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    return getLocaleServiceProvider(CalendarDataProvider.class);
}
项目:OpenJSharp    文件:SPILocaleProviderAdapter.java   
@Override
public void addImpl(CalendarDataProvider impl) {
    for (Locale l : impl.getAvailableLocales()) {
        map.putIfAbsent(l, impl);
    }
}
项目:OpenJSharp    文件:SPILocaleProviderAdapter.java   
@Override
public CalendarDataProvider getImpl(Locale locale) {
    return SPILocaleProviderAdapter.getImpl(map, locale);
}
项目:jdk8u-jdk    文件:AuxLocaleProviderAdapter.java   
@Override
public CalendarDataProvider getCalendarDataProvider() {
    return getLocaleServiceProvider(CalendarDataProvider.class);
}