The main method people will use is getBestPattern(String skeleton), since normally this class is pre-built with data from a particular locale. However, generators can be built directly from other data as well.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class | |
| private class | |
| private static class | |
| private static class | |
| public static enum | DateTimePatternGenerator.DisplayWidth
Field display name width constants for getFieldDisplayName |
| private static class | |
| private static enum | |
| public static class | DateTimePatternGenerator.FormatParser
Deprecated
This API is ICU internal only.
This class provides mechanisms for parsing a SimpleDateFormat pattern
or generating a new pattern, while handling the quoting.
|
| public static class | DateTimePatternGenerator.PatternInfo
PatternInfo supplies output parameters for addPattern(...). |
| private static class | |
| private static class | |
| private static class | DateTimePatternGenerator.SkeletonFields
A compact storage mechanism for skeleton field strings. |
| public static class | DateTimePatternGenerator.VariableField
Deprecated
This API is ICU internal only.
Utility class for FormatParser.
|
| Modifier and Type | Field and Description |
|---|---|
| private transient DateTimePatternGenerator. | |
| private String[] | |
| private static final DateTimePatternGenerator. | APPENDITEM_WIDTH
The field name width for use in appendItems |
| private static final int | |
| private String[] | |
| private TreeMap | |
| private static final String[] | |
| private static final Set | |
| private static final String[] | |
| private static final String[] | |
| private static final DateTimePatternGenerator. | |
| private Set | |
| private transient DateTimePatternGenerator. | |
| private static final int | |
| private String[] | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| private static final boolean | |
| private String | |
| private char | |
| private static final int | |
| private static ICUCache | |
| public static final int | |
| private static final int | |
| private static final String[] | |
| private String[][] | |
| private transient DateTimePatternGenerator. | fp
Deprecated
as a consequence of
DateTimePatternGenerator.FormatParser being deprecated.
|
| private static final int | |
| public static final int | |
| private volatile boolean | |
| public static final int | |
| private static final String[] | |
| pack-priv static final Map | |
| private static final int | |
| public static final int | MATCH_ALL_FIELDS_LENGTH
Option mask for forcing the width of all date and time fields. |
| public static final int | MATCH_HOUR_FIELD_LENGTH
Option mask for forcing the width of hour field. |
| public static final int | MATCH_MINUTE_FIELD_LENGTH
Option mask for forcing the width of minute field. |
| public static final int | MATCH_NO_OPTIONS
Default option mask used for |
| public static final int | MATCH_SECOND_FIELD_LENGTH
Option mask for forcing the width of second field. |
| public static final int | |
| private static final int | |
| public static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| public static final int | |
| public static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private TreeMap | |
| private static final int | |
| public static final int | TYPE_LIMIT
One more than the highest normal field number. |
| private static final int[][] | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| private void | |
| public DateTimePatternGenerator | addPattern(String
Pattern to add. pattern, boolean When existing values are to be overridden use true, otherwise
use false. override, DateTimePatternGenerator.Returned information. returnInfoAdds a pattern to the generator. |
| public DateTimePatternGenerator | addPatternWithSkeleton(String pattern, String skeletonToUse, boolean override, DateTimePatternGenerator.
Deprecated
This API is ICU internal only.
addPatternWithSkeleton:
If skeletonToUse is specified, then an availableFormats entry is being added.
|
| private String | adjustFieldTypes(DateTimePatternGenerator.
|
| private void | |
| public Object | Returns: A copy of thisDateTimePatternGenerator object.Overrides java. DateTimePatternGenerator object.
|
| public DateTimePatternGenerator | cloneAsThawed()
Implements com. |
| private void | |
| private void | |
| public DateTimePatternGenerator | |
| private void | |
| private String[] | |
| private String | |
| public static int | |
| public static int | |
| public String | Returns: append pattern for fieldThe index to retrieve the append item formats. field)Getter corresponding to setAppendItemFormats. |
| public String | Returns: name for fieldThe index to get the append item name. field)Getter corresponding to setAppendItemName. |
| private String | |
| public String | Returns: skeleton, such as "MMMdd"Input pattern, such as "dd/MMM" pattern)Utility to return a unique base skeleton from a given pattern. |
| public Set | getBaseSkeletons(Set<String> result)
Return a list of all the base skeletons (in canonical form) from this class |
| private String | getBestAppending(DateTimePatternGenerator.
We only get called here if we failed to find an exact skeleton. |
| public String | Returns: Best pattern matching the input skeleton.The skeleton is a pattern containing only the variable fields.
For example, "MMMdd" and "mmhh" are skeletons. skeleton)Return the best pattern matching the input skeleton. |
| public String | Returns: Best pattern matching the input skeleton (and options).The skeleton is a pattern containing only the variable fields.
For example, "MMMdd" and "mmhh" are skeletons. skeleton, int MATCH_xxx options for forcing the length of specified fields in
the returned pattern to match those in the skeleton (when this would
not happen otherwise). For default behavior, use MATCH_NO_OPTIONS. options)Return the best pattern matching the input skeleton. |
| private String | |
| private DateTimePatternGenerator. | getBestRaw(DateTimePatternGenerator.
|
| private String | |
| private static char | getCanonicalChar(int field, char reference)
Gets the canonical character associated with the specified field (ERA, YEAR, etc). |
| private static int | |
| public String | Returns: skeleton, such as "MMMEd"Input pattern, such as "ccc, d LLL" pattern)
Deprecated
This API is ICU internal only.
Same as getSkeleton, but allows duplicates
and returns a string using canonical pattern chars
|
| private static int | |
| public String | |
| public String | Returns: the current dateTimeFormat for the specified style.one of DateFormat.FULL..DateFormat.SHORT. An exception will
be thrown if out of range. style)Getter corresponding to setDateTimeFormat. |
| public String | |
| public DateFormat. | |
| public char | |
| public static DateTimePatternGenerator | |
| public String | Returns: The display name for the fieldThe field type, such as ERA. field, DateTimePatternGenerator.The desired DisplayWidth, such as DisplayWidth.ABBREVIATED. widthThe general interface to get a display name for a particular date/time field, in one of several possible display widths. |
| public String | |
| private static String | getFilteredPattern(DateTimePatternGenerator.
Deprecated
as a consequence of
DateTimePatternGenerator.FormatParser being deprecated.
|
| public static DateTimePatternGenerator | Returns: A frozen DateTimePatternGenerator.The locale to pass. uLocale)
Deprecated
This API is ICU internal only.
Construct a frozen instance of DateTimePatternGenerator for a
given locale.
|
| public static DateTimePatternGenerator | |
| public static DateTimePatternGenerator | getInstance(ULocale
The locale to pass. uLocale)Construct a flexible generator according to data for a given locale. |
| public static DateTimePatternGenerator | getInstance(Locale
The locale)java. to pass.Construct a flexible generator according to data for a given locale. |
| public static DateTimePatternGenerator | getInstanceNoStdPat(ULocale
The locale to pass. uLocale)
Deprecated
This API is ICU internal only.
Construct a non-frozen instance of DateTimePatternGenerator for a
given locale that skips using the standard date and time patterns.
|
| private static String | |
| public Collection | Returns: the collection with added elements.stores the redundant patterns that are removed. To get these
in internal order, supply a LinkedHashSet. If null, a
collection is allocated. output)
Deprecated
This API is ICU internal only.
Redundant patterns are those which if removed, make no difference in the
resulting getBestPattern values.
|
| private TreeSet | |
| public String | Returns: skeleton, such as "MMMdd"Input pattern, such as "dd/MMM" pattern)Utility to return a unique skeleton from a given pattern. |
| public String | Returns: skeleton, such as "MMMdd"Input pattern, such as "dd/MMM" pattern)
Deprecated
This API is ICU internal only.
Same as getSkeleton, but allows duplicates
|
| public Map | Returns: the input Map containing the values.an output Map in which to place the mapping from skeleton to
pattern. If you want to see the internal order being used,
supply a LinkedHashMap. If the input value is null, then a
LinkedHashMap is allocated. result)Issue an alternate API would be to just return a list of the skeletons, and then have a separate routine to get from skeleton to pattern. Return a list of all the skeletons (in canonical form) from this class, and the patterns that they map to. |
| private int | |
| private void | |
| private void | |
| private boolean | Returns: true if the corresponding slot of CLDR_AVAIL_FORMAT_KEY[] has been added to DateTimePatternGenerator.of the availableFormatMask in CLDR key)This function checks the corresponding slot of CLDR_AVAIL_FORMAT_KEY[] has been added to DateTimePatternGenerator. |
| public boolean | isFrozen()
Implements com. |
| public static boolean | Returns: true or notThe skeleton to determine if it contains a single field. skeleton)
Deprecated
This API is ICU internal only.
Determines whether a skeleton contains a single field
|
| private String | |
| public String | Returns: pattern adjusted to match the skeleton fields widths and subtypes.input pattern pattern, String For the pattern to match to. skeleton)Adjusts the field types (width and subtype) of a pattern to match what is in a skeleton. |
| public String | Returns: pattern adjusted to match the skeleton fields widths and subtypes.input pattern pattern, String For the pattern to match to. skeleton, int MATCH_xxx options for forcing the length of specified fields in
the returned pattern to match those in the skeleton (when this would
not happen otherwise). For default behavior, use MATCH_NO_OPTIONS. options)Adjusts the field types (width and subtype) of a pattern to match what is in a skeleton. |
| public void | setAppendItemFormat(int
such as ERA field, String pattern, such as "{0}, {1}" value)An AppendItem format is a pattern used to append a field if there is no good match. |
| public void | setAppendItemName(int
Index of the append item names. field, String The value to set the item to. value)Sets the names of fields, eg "era" in English for ERA. |
| private void | setAvailableFormat(String
of the availableFormats in CLDR key)Add key to HashSet cldrAvailableFormatKeys. |
| public void | setDateTimeFormat(String
message format pattern, where {1} will be replaced by the date
pattern and {0} will be replaced by the time pattern. dateTimeFormat)The date time format is a message format pattern used to compose date and time patterns. |
| public void | setDateTimeFormat(int
one of DateFormat.FULL..DateFormat.SHORT. An exception will
be thrown if out of range. style, String the new dateTimeFormat to set for the specified style dateTimeFormat)dateTimeFormats are message patterns used to compose combinations of date and time patterns. |
| private void | |
| public void | setDecimal(String
The decimal to set to. decimal)The decimal value is used in formatting fractions of seconds. |
| private void | |
| public void | |
| private void | setFieldDisplayName(int
The field type, such as ERA. field, DateTimePatternGenerator.The desired DisplayWidth, such as DisplayWidth.ABBREVIATED. width,The display name to set value)
Deprecated
This API is ICU internal only.
The private interface to set a display name for a particular date/time field,
in one of several possible display widths.
|
| private static String | |
| public boolean | skeletonsAreSimilar(String id, String skeleton)
Deprecated
This API is ICU internal only.
Used by CLDR tooling; not in ICU4C.
|