summaryrefslogtreecommitdiff
path: root/android_icu4j
diff options
context:
space:
mode:
authorVictor Chang <vichang@google.com>2021-04-01 17:41:49 +0100
committervichang <vichang@google.com>2021-04-01 16:47:24 +0000
commit46496f3ee06a2ed07262a24731246798f5d80f48 (patch)
treef5fee311564f7aa2c8dceb32f1cc7f26e38a1144 /android_icu4j
parentafd8455030f479105b0050f58510ff80e5b5b26a (diff)
downloadicu-46496f3ee06a2ed07262a24731246798f5d80f48.tar.gz
Add options argument to CorePlatformApi DateTimePatternGenerator#getBestPattern
Bug: 184018008 Test: m droid Change-Id: Ifc2eb7e10590016d8abb31835bbb167bbc779fbc
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 17cb11a81..7967d482f 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) {