summaryrefslogtreecommitdiff
path: root/android_icu4j
diff options
context:
space:
mode:
authorvichang <vichang@google.com>2021-04-21 14:52:13 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-04-21 14:52:13 +0000
commit1b51f6391cc7bc2de889a1d1a23f6b5ca5696f8e (patch)
tree59678054a33d2f0d34daf497f7cf73055e712a0b /android_icu4j
parent44f8e62eea78d597e65b700bfc664c540b51a078 (diff)
parent46496f3ee06a2ed07262a24731246798f5d80f48 (diff)
downloadicu-1b51f6391cc7bc2de889a1d1a23f6b5ca5696f8e.tar.gz
Merge "Add options argument to CorePlatformApi DateTimePatternGenerator#getBestPattern"
Diffstat (limited to 'android_icu4j')
-rw-r--r--android_icu4j/api/legacy_platform/current.txt2
-rw-r--r--android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java14
2 files changed, 13 insertions, 3 deletions
diff --git a/android_icu4j/api/legacy_platform/current.txt b/android_icu4j/api/legacy_platform/current.txt
index 31a5337f0..a81a0c650 100644
--- a/android_icu4j/api/legacy_platform/current.txt
+++ b/android_icu4j/api/legacy_platform/current.txt
@@ -14,7 +14,7 @@ package android.icu.text {
}
public class DateTimePatternGenerator implements java.lang.Cloneable android.icu.util.Freezable<android.icu.text.DateTimePatternGenerator> {
- method public String getBestPattern(String, boolean);
+ method public String getBestPattern(String, int, boolean);
}
public final class StringPrep {
diff --git a/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java b/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java
index c2ec9e669..3d667d064 100644
--- a/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java
+++ b/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java
@@ -643,11 +643,21 @@ public class DateTimePatternGenerator implements Freezable<DateTimePatternGenera
// BEGIN Android-added: http://b/170233598 Allow duplicate fields
/**
+ * Return the best pattern matching the input skeleton. It is guaranteed to
+ * have all of the fields in the skeleton.
+ *
+ * @param skeleton The skeleton is a pattern containing only the variable fields.
+ * For example, "MMMdd" and "mmhh" are skeletons.
+ * @param options 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.
+ * @param allowDuplicateFields allows duplicated field in the skeleton
+ * @return Best pattern matching the input skeleton (and options).
* @hide draft / provisional / internal are hidden on Android
*/
@libcore.api.CorePlatformApi
- public String getBestPattern(String skeleton, boolean allowDuplicateFields) {
- return getBestPattern(skeleton, null, MATCH_NO_OPTIONS, allowDuplicateFields);
+ public String getBestPattern(String skeleton, int options, boolean allowDuplicateFields) {
+ return getBestPattern(skeleton, null, options, allowDuplicateFields);
}
private String getBestPattern(String skeleton, DateTimeMatcher skipMatcher, int options) {