本文整理匯總了Java中java.util.Locale.UK屬性的典型用法代碼示例。如果您正苦於以下問題:Java Locale.UK屬性的具體用法?Java Locale.UK怎麽用?Java Locale.UK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.util.Locale
的用法示例。
在下文中一共展示了Locale.UK屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: data_date
@DataProvider(name="date")
Object[][] data_date() {
return new Object[][] {
{LocalDate.of(2012, 6, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.UK},
{LocalDate.of(2012, 6, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.US},
{LocalDate.of(2012, 6, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.FRANCE},
{LocalDate.of(2012, 6, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.JAPAN},
{LocalDate.of(2012, 6, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.UK},
{LocalDate.of(2012, 6, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.US},
{LocalDate.of(2012, 6, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.FRANCE},
{LocalDate.of(2012, 6, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.JAPAN},
{LocalDate.of(2012, 6, 30), FormatStyle.LONG, DateFormat.LONG, Locale.UK},
{LocalDate.of(2012, 6, 30), FormatStyle.LONG, DateFormat.LONG, Locale.US},
{LocalDate.of(2012, 6, 30), FormatStyle.LONG, DateFormat.LONG, Locale.FRANCE},
{LocalDate.of(2012, 6, 30), FormatStyle.LONG, DateFormat.LONG, Locale.JAPAN},
{LocalDate.of(2012, 6, 30), FormatStyle.FULL, DateFormat.FULL, Locale.UK},
{LocalDate.of(2012, 6, 30), FormatStyle.FULL, DateFormat.FULL, Locale.US},
{LocalDate.of(2012, 6, 30), FormatStyle.FULL, DateFormat.FULL, Locale.FRANCE},
{LocalDate.of(2012, 6, 30), FormatStyle.FULL, DateFormat.FULL, Locale.JAPAN},
};
}
示例2: data_time
@DataProvider(name="time")
Object[][] data_time() {
return new Object[][] {
{LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.UK},
{LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.US},
{LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.FRANCE},
{LocalTime.of(11, 30), FormatStyle.SHORT, DateFormat.SHORT, Locale.JAPAN},
{LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.UK},
{LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.US},
{LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.FRANCE},
{LocalTime.of(11, 30), FormatStyle.MEDIUM, DateFormat.MEDIUM, Locale.JAPAN},
// these localized patterns include "z" which isn't available from LocalTime
// {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.UK},
// {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.US},
// {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.FRANCE},
// {LocalTime.of(11, 30), FormatStyle.LONG, DateFormat.LONG, Locale.JAPAN},
//
// {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.UK},
// {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.US},
// {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.FRANCE},
// {LocalTime.of(11, 30), FormatStyle.FULL, DateFormat.FULL, Locale.JAPAN},
};
}
示例3: providerDayOfWeekData
@DataProvider(name="print_DayOfWeekData")
Object[][] providerDayOfWeekData() {
return new Object[][] {
// Locale, pattern, expected text, input DayOfWeek
{Locale.US, "e", "1", DayOfWeek.SUNDAY},
{Locale.US, "ee", "01", DayOfWeek.SUNDAY},
{Locale.US, "c", "1", DayOfWeek.SUNDAY},
{Locale.UK, "e", "1", DayOfWeek.MONDAY},
{Locale.UK, "ee", "01", DayOfWeek.MONDAY},
{Locale.UK, "c", "1", DayOfWeek.MONDAY},
};
}
示例4: testIdentity
public void testIdentity()
{
Locale locale = Locale.UK;
HashSet<Locale> locales = new HashSet<Locale>();
locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.LOCALE_ONLY, locale, false));
assertEquals(1, locales.size());
assertTrue(locales.contains(locale));
}
示例5: testIdentityAndAll
public void testIdentityAndAll()
{
Locale locale = Locale.UK;
HashSet<Locale> locales = new HashSet<Locale>();
locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.LOCALE_AND_ALL, locale, false));
assertEquals(2, locales.size());
assertTrue(locales.contains(locale));
assertTrue(locales.contains(new Locale("", "", "")));
}
示例6: testAll
public void testAll()
{
Locale locale = Locale.UK;
HashSet<Locale> locales = new HashSet<Locale>();
locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.ALL_ONLY, locale, false));
assertEquals(1, locales.size());
assertTrue(locales.contains(new Locale("", "", "")));
}
示例7: main
public static void main(String args[]) {
Bug8154797.generateExpectedValues();
Locale[] locArr = {new Locale("hi", "IN"), Locale.UK, new Locale("fi", "FI"),
Locale.ROOT, Locale.GERMAN, Locale.JAPANESE,
Locale.ENGLISH, Locale.FRANCE};
for (Locale loc : locArr) {
Bug8154797.compareResources(loc);
}
}
示例8: testIdentityWC
public void testIdentityWC()
{
Locale locale = Locale.UK;
HashSet<Locale> locales = new HashSet<Locale>();
locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.LOCALE_ONLY, locale, true));
assertEquals(1, locales.size());
assertTrue(locales.contains(locale));
}
示例9: testIdentityAndAllWC
public void testIdentityAndAllWC()
{
Locale locale = Locale.UK;
HashSet<Locale> locales = new HashSet<Locale>();
locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.LOCALE_AND_ALL, locale, true));
assertEquals(3, locales.size());
assertTrue(locales.contains(locale));
assertTrue(locales.contains(new Locale("", "", "")));
assertTrue(locales.contains(new Locale("*", "", "")));
}
示例10: testAllWC
public void testAllWC()
{
Locale locale = Locale.UK;
HashSet<Locale> locales = new HashSet<Locale>();
locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.ALL_ONLY, locale, true));
assertEquals(2, locales.size());
assertTrue(locales.contains(new Locale("", "", "")));
assertTrue(locales.contains(new Locale("*", "", "")));
}
示例11: testContainingWC
public void testContainingWC()
{
Locale locale = Locale.UK;
HashSet<Locale> locales = new HashSet<Locale>();
locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.LOCALE_AND_ALL_CONTAINING_LOCALES, locale, true));
assertEquals(2, locales.size());
assertTrue(locales.contains(new Locale("en", "", "")));
assertTrue(locales.contains(new Locale("en", "GB", "")));
}
示例12: testContainingAndAllWC
public void testContainingAndAllWC()
{
Locale locale = Locale.UK;
HashSet<Locale> locales = new HashSet<Locale>();
locales.addAll(MLAnalysisMode.getLocales(MLAnalysisMode.LOCALE_AND_ALL_CONTAINING_LOCALES_AND_ALL, locale, true));
assertEquals(4, locales.size());
assertTrue(locales.contains(new Locale("", "", "")));
assertTrue(locales.contains(new Locale("*", "", "")));
assertTrue(locales.contains(new Locale("en", "", "")));
assertTrue(locales.contains(new Locale("en", "GB", "")));
}
示例13: process
/**
* process
*
* @param value
* @return
*/
private Object process(Object value) {
try {
if (value instanceof Date) {
SimpleDateFormat sdf = new SimpleDateFormat(datePattern, Locale.UK);
return sdf.format((Date) value);
}
return value == null ? "" : value.toString();
} catch (Exception e) {
return "";
}
}
示例14: initialValue
@Override
protected DateFormat initialValue() {
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmXXX", Locale.UK);
format.setTimeZone(TimeZone.getTimeZone("UTC"));
return format;
}
示例15: initialValue
protected DateFormat initialValue() {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd\'T\'HH:mmZ", Locale.UK);
format.setTimeZone(TimeZone.getTimeZone("UTC"));
return format;
}