Java Code Examples for java.util.Locale.UK

The following are Jave code examples for showing how to use UK of the java.util.Locale class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: openjdk-jdk10   File: TCKLocalizedPrinterParser.java   View Source Code Vote up 6 votes
@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},
    };
}
 
Example 2
Project: jdk8u-jdk   File: TCKLocalizedPrinterParser.java   View Source Code Vote up 6 votes
@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},
        };
    }
 
Example 3
Project: jdk8u-jdk   File: TestTextPrinter.java   View Source Code Vote up 5 votes
@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},
    };
}
 
Example 4
Project: alfresco-repository   File: MLAnaysisModeExpansionTest.java   View Source Code Vote up 5 votes
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));
}
 
Example 5
Project: alfresco-repository   File: MLAnaysisModeExpansionTest.java   View Source Code Vote up 5 votes
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("", "", "")));
}
 
Example 6
Project: alfresco-repository   File: MLAnaysisModeExpansionTest.java   View Source Code Vote up 5 votes
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("", "", "")));
}
 
Example 7
Project: openjdk-jdk10   File: Bug8154797.java   View Source Code Vote up 5 votes
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);
    }
}
 
Example 8
Project: openjdk-jdk10   File: TestTextPrinterWithLocale.java   View Source Code Vote up 5 votes
@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},
    };
}
 
Example 9
Project: alfresco-repository   File: MLAnaysisModeExpansionTest.java   View Source Code Vote up 5 votes
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));
}
 
Example 10
Project: alfresco-repository   File: MLAnaysisModeExpansionTest.java   View Source Code Vote up 5 votes
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("*", "", "")));
}
 
Example 11
Project: alfresco-repository   File: MLAnaysisModeExpansionTest.java   View Source Code Vote up 5 votes
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("*", "", "")));
}
 
Example 12
Project: alfresco-repository   File: MLAnaysisModeExpansionTest.java   View Source Code Vote up 5 votes
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", "")));
}
 
Example 13
Project: alfresco-repository   File: MLAnaysisModeExpansionTest.java   View Source Code Vote up 5 votes
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", "")));
}
 
Example 14
Project: openjdk-jdk10   File: TCKLocalizedPrinterParser.java   View Source Code Vote up 5 votes
@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},
        };
    }
 
Example 15
Project: xcx-specialty   File: JsonDateValueProcessor.java   View Source Code Vote up 5 votes
/** 
 * 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 "";  
    }  
  
}
 
Example 16
Project: rapidminer   File: LicenseTools.java   View Source Code Vote up 4 votes
@Override
protected DateFormat initialValue() {
	DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mmXXX", Locale.UK);
	format.setTimeZone(TimeZone.getTimeZone("UTC"));
	return format;
}
 
Example 17
Project: rapidminer   File: NexusUtilities.java   View Source Code Vote up 4 votes
protected DateFormat initialValue() {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd\'T\'HH:mmZ", Locale.UK);
    format.setTimeZone(TimeZone.getTimeZone("UTC"));
    return format;
}
 
Example 18
Project: rapidminer   File: RapidMinerAccount.java   View Source Code Vote up 4 votes
protected DateFormat initialValue() {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd\'T\'HH:mmXXX", Locale.UK);
    format.setTimeZone(TimeZone.getTimeZone("UTC"));
    return format;
}
 
Example 19
Project: gofun-app   File: DateTimeUtil.java   View Source Code Vote up 4 votes
public static String getDateTimeFromCurrentTime(String currentTimeMillis) {
    long currentTime = Long.parseLong(currentTimeMillis);
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("hh:mm a", Locale.UK);
    Date resultDate = new Date(currentTime);
    return simpleDateFormat.format(resultDate);
}
 
Example 20
Project: gofun-app   File: DateTimeUtil.java   View Source Code Vote up 4 votes
public static String getTimeFromMillis(long millis) {
    SimpleDateFormat simpleDateFormat = new SimpleDateFormat(Constants.Timer.TIME_FORMAT,
            Locale.UK);
    Date date = new Date(millis);
    return simpleDateFormat.format(date);
}