Java Code Examples for java.time.format.TextStyle#NARROW

The following examples show how to use java.time.format.TextStyle#NARROW . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JapaneseEra.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @param style {@inheritDoc}
 * @param locale {@inheritDoc}
 */
@Override
public String getDisplayName(TextStyle style, Locale locale) {
    // If this JapaneseEra is a supplemental one, obtain the name from
    // the era definition.
    if (getValue() > N_ERA_CONSTANTS - ERA_OFFSET) {
        Objects.requireNonNull(locale, "locale");
        return style.asNormal() == TextStyle.NARROW ? getAbbreviation() : getName();
    }

    return new DateTimeFormatterBuilder()
        .appendText(ERA, style)
        .toFormatter(locale)
        .withChronology(JapaneseChronology.INSTANCE)
        .format(this == MEIJI ? MEIJI_6_ISODATE : since);
}
 
Example 2
Source File: JapaneseEra.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @param style {@inheritDoc}
 * @param locale {@inheritDoc}
 */
@Override
public String getDisplayName(TextStyle style, Locale locale) {
    // If this JapaneseEra is a supplemental one, obtain the name from
    // the era definition.
    if (getValue() > N_ERA_CONSTANTS - ERA_OFFSET) {
        Objects.requireNonNull(locale, "locale");
        return style.asNormal() == TextStyle.NARROW ? getAbbreviation() : getName();
    }

    return new DateTimeFormatterBuilder()
        .appendText(ERA, style)
        .toFormatter(locale)
        .withChronology(JapaneseChronology.INSTANCE)
        .format(this == MEIJI ? MEIJI_6_ISODATE : since);
}
 
Example 3
Source File: JapaneseEra.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @param style {@inheritDoc}
 * @param locale {@inheritDoc}
 */
@Override
public String getDisplayName(TextStyle style, Locale locale) {
    // If this JapaneseEra is a supplemental one, obtain the name from
    // the era definition.
    if (getValue() > N_ERA_CONSTANTS - ERA_OFFSET) {
        Objects.requireNonNull(locale, "locale");
        return style.asNormal() == TextStyle.NARROW ? getAbbreviation() : getName();
    }

    return new DateTimeFormatterBuilder()
        .appendText(ERA, style)
        .toFormatter(locale)
        .withChronology(JapaneseChronology.INSTANCE)
        .format(this == MEIJI ? MEIJI_6_ISODATE : since);
}
 
Example 4
Source File: JapaneseEra.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @param style {@inheritDoc}
 * @param locale {@inheritDoc}
 */
@Override
public String getDisplayName(TextStyle style, Locale locale) {
    // If this JapaneseEra is a supplemental one, obtain the name from
    // the era definition.
    if (getValue() > N_ERA_CONSTANTS - ERA_OFFSET) {
        Objects.requireNonNull(locale, "locale");
        return style.asNormal() == TextStyle.NARROW ? getAbbreviation() : getName();
    }

    return new DateTimeFormatterBuilder()
        .appendText(ERA, style)
        .toFormatter(locale)
        .withChronology(JapaneseChronology.INSTANCE)
        .format(this == MEIJI ? MEIJI_6_ISODATE : since);
}
 
Example 5
Source File: TestTextPrinter.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_JapaneseChronology")
Object[][] provider_japaneseEra() {
   return new Object[][] {
        {ERA,           TextStyle.FULL, 2, "Heisei"}, // Note: CLDR doesn't define "wide" Japanese era names.
        {ERA,           TextStyle.SHORT, 2, "Heisei"},
        {ERA,           TextStyle.NARROW, 2, "H"},
   };
}
 
Example 6
Source File: TestTextPrinterWithLocale.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_JapaneseChronology")
Object[][] provider_japaneseEra() {
   return new Object[][] {
        {ERA,           TextStyle.FULL, 2, "Heisei"}, // Note: CLDR doesn't define "wide" Japanese era names.
        {ERA,           TextStyle.SHORT, 2, "Heisei"},
        {ERA,           TextStyle.NARROW, 2, "H"},
   };
}
 
Example 7
Source File: TestTextPrinter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_JapaneseChronology")
Object[][] provider_japaneseEra() {
   return new Object[][] {
        {ERA,           TextStyle.FULL, 2, "Heisei"}, // Note: CLDR doesn't define "wide" Japanese era names.
        {ERA,           TextStyle.SHORT, 2, "Heisei"},
        {ERA,           TextStyle.NARROW, 2, "H"},
   };
}
 
Example 8
Source File: JapaneseEra.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @param style {@inheritDoc}
 * @param locale {@inheritDoc}
 */
@Override
public String getDisplayName(TextStyle style, Locale locale) {
    // If this JapaneseEra is a supplemental one, obtain the name from
    // the era definition.
    if (getValue() > N_ERA_CONSTANTS - ERA_OFFSET) {
        Objects.requireNonNull(locale, "locale");
        return style.asNormal() == TextStyle.NARROW ? getAbbreviation() : getName();
    }
    return Era.super.getDisplayName(style, locale);
}
 
Example 9
Source File: TestTextPrinter.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_JapaneseChronology")
Object[][] provider_japaneseEra() {
   return new Object[][] {
        {ERA,           TextStyle.FULL, 2, "Heisei"}, // Note: CLDR doesn't define "wide" Japanese era names.
        {ERA,           TextStyle.SHORT, 2, "Heisei"},
        {ERA,           TextStyle.NARROW, 2, "H"},
   };
}
 
Example 10
Source File: JapaneseEra.java    From desugar_jdk_libs with GNU General Public License v2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @param style {@inheritDoc}
 * @param locale {@inheritDoc}
 */
@Override
public String getDisplayName(TextStyle style, Locale locale) {
    // If this JapaneseEra is a supplemental one, obtain the name from
    // the era definition.
    if (getValue() > N_ERA_CONSTANTS - ERA_OFFSET) {
        Objects.requireNonNull(locale, "locale");
        return style.asNormal() == TextStyle.NARROW ? getAbbreviation() : getName();
    }
    return Era.super.getDisplayName(style, locale);
}
 
Example 11
Source File: TestTextPrinter.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_JapaneseChronology")
Object[][] provider_japaneseEra() {
   return new Object[][] {
        {ERA,           TextStyle.FULL, 2, "Heisei"}, // Note: CLDR doesn't define "wide" Japanese era names.
        {ERA,           TextStyle.SHORT, 2, "Heisei"},
        {ERA,           TextStyle.NARROW, 2, "H"},
   };
}
 
Example 12
Source File: TestTextPrinter.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@DataProvider(name="print_JapaneseChronology")
Object[][] provider_japaneseEra() {
   return new Object[][] {
        {ERA,           TextStyle.FULL, 2, "Heisei"}, // Note: CLDR doesn't define "wide" Japanese era names.
        {ERA,           TextStyle.SHORT, 2, "Heisei"},
        {ERA,           TextStyle.NARROW, 2, "H"},
   };
}
 
Example 13
Source File: TestTextParser.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name="parseText")
Object[][] provider_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},

        {QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},

        {QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},

        {QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
   };
}
 
Example 14
Source File: TestTextParser.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name="parseText")
Object[][] provider_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},

        {QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},

        {QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},

        {QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
   };
}
 
Example 15
Source File: TestTextParser.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name="parseText")
Object[][] provider_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},

        {QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},

        {QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},

        {QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
   };
}
 
Example 16
Source File: TestTextParser.java    From j2objc with Apache License 2.0 4 votes vote down vote up
@DataProvider
public static Object[][] provider_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},

        {QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},

        {QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},

        {QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
   };
}
 
Example 17
Source File: TestTextParser.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name="parseText")
Object[][] provider_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},

        {QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},

        {QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},

        {QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
   };
}
 
Example 18
Source File: TestTextParser.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name="parseText")
Object[][] provider_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},

        {QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},

        {QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},

        {QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
   };
}
 
Example 19
Source File: TestTextParser.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name="parseText")
Object[][] provider_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},

        {QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},

        {QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},

        {QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
   };
}
 
Example 20
Source File: TestTextParser.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@DataProvider(name="parseText")
Object[][] provider_text() {
    return new Object[][] {
        {DAY_OF_WEEK, TextStyle.FULL, 1, "Monday"},
        {DAY_OF_WEEK, TextStyle.FULL, 2, "Tuesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 3, "Wednesday"},
        {DAY_OF_WEEK, TextStyle.FULL, 4, "Thursday"},
        {DAY_OF_WEEK, TextStyle.FULL, 5, "Friday"},
        {DAY_OF_WEEK, TextStyle.FULL, 6, "Saturday"},
        {DAY_OF_WEEK, TextStyle.FULL, 7, "Sunday"},

        {DAY_OF_WEEK, TextStyle.SHORT, 1, "Mon"},
        {DAY_OF_WEEK, TextStyle.SHORT, 2, "Tue"},
        {DAY_OF_WEEK, TextStyle.SHORT, 3, "Wed"},
        {DAY_OF_WEEK, TextStyle.SHORT, 4, "Thu"},
        {DAY_OF_WEEK, TextStyle.SHORT, 5, "Fri"},
        {DAY_OF_WEEK, TextStyle.SHORT, 6, "Sat"},
        {DAY_OF_WEEK, TextStyle.SHORT, 7, "Sun"},

        {MONTH_OF_YEAR, TextStyle.FULL, 1, "January"},
        {MONTH_OF_YEAR, TextStyle.FULL, 12, "December"},

        {MONTH_OF_YEAR, TextStyle.SHORT, 1, "Jan"},
        {MONTH_OF_YEAR, TextStyle.SHORT, 12, "Dec"},

        {QUARTER_OF_YEAR, TextStyle.FULL, 1, "1st quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 2, "2nd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 3, "3rd quarter"},
        {QUARTER_OF_YEAR, TextStyle.FULL, 4, "4th quarter"},

        {QUARTER_OF_YEAR, TextStyle.SHORT, 1, "Q1"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 2, "Q2"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 3, "Q3"},
        {QUARTER_OF_YEAR, TextStyle.SHORT, 4, "Q4"},

        {QUARTER_OF_YEAR, TextStyle.NARROW, 1, "1"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 2, "2"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 3, "3"},
        {QUARTER_OF_YEAR, TextStyle.NARROW, 4, "4"},
   };
}