/**
* 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(),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,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,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,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,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,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,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,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,locale);
default:
assert false : "should not happen";
}
return null;
}
项目:jdk-1.7-annotated
文件:DateFormat.java
public DateFormat getobject(DateFormatProvider dateFormatProvider,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,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,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,loc);
}
return dateFormat;
}
项目:jdk7-jdk
文件:DateFormat.java
public DateFormat getobject(DateFormatProvider dateFormatProvider,locale);
default:
assert false : "should not happen";
}
return null;
}
项目:openjdk-source-code-learn
文件:DateFormat.java
public DateFormat getobject(DateFormatProvider dateFormatProvider,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,loc);
}
return dateFormat;
}
项目:openjdk-jdk7u-jdk
文件:DateFormat.java
public DateFormat getobject(DateFormatProvider dateFormatProvider,locale);
default:
assert false : "should not happen";
}
return null;
}
项目:openjdk-icedtea7
文件:DateFormat.java
public DateFormat getobject(DateFormatProvider dateFormatProvider,locale);
default:
assert false : "should not happen";
}
return null;
}
private static DateFormat get(LocaleProviderAdapter adapter,int timeStyle,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,loc);
}
}
return dateFormat;
}
@Override
public DateFormatProvider getDateFormatProvider() {
if (dateFormatProvider == null) {
DateFormatProvider provider = new DateFormatProviderImpl(getAdapterType(),getLanguageTagSet("FormatData"));
synchronized (this) {
if (dateFormatProvider == null) {
dateFormatProvider = provider;
}
}
}
return dateFormatProvider;
}
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,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,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,loc);
}
}
return dateFormat;
}
项目:openjdk-jdk10
文件:JSpinner.java
private static String getDefaultPattern(Locale loc) {
LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class,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,loc);
}
}
return dateFormat;
}
项目:openjdk9
文件:JSpinner.java
private static String getDefaultPattern(Locale loc) {
LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class,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,loc);
}
}
return dateFormat;
}
项目:Java8CN
文件:JSpinner.java
private static String getDefaultPattern(Locale loc) {
LocaleProviderAdapter adapter = LocaleProviderAdapter.getAdapter(DateFormatProvider.class,null);
}
项目:NonDex
文件:DateFormat.java
private static DateFormat get(LocaleProviderAdapter adapter,loc);
}
}
return dateFormat;
}
项目:jdk8u_jdk
文件:DateFormat.java
private static DateFormat get(LocaleProviderAdapter adapter,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,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,loc);
}
}
return dateFormat;
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。