From 03955adbd35f3620963a5c856d88de2a75ee153d Mon Sep 17 00:00:00 2001 From: Yoshito Umaoka Date: Tue, 9 Sep 2014 21:54:10 +0000 Subject: [PATCH] ICU-10993 Fixed API status tag problems. X-SVN-Rev: 36412 --- .../core/src/com/ibm/icu/lang/UScript.java | 1 + .../src/com/ibm/icu/text/PluralRanges.java | 88 ++++++++++++++----- .../core/src/com/ibm/icu/text/UTF16.java | 6 ++ .../core/src/com/ibm/icu/text/UnicodeSet.java | 27 +++++- .../com/ibm/icu/text/UnicodeSetSpanner.java | 69 +++++++++++++-- .../core/src/com/ibm/icu/util/Calendar.java | 84 ++++++++++++++---- 6 files changed, 228 insertions(+), 47 deletions(-) diff --git a/icu4j/main/classes/core/src/com/ibm/icu/lang/UScript.java b/icu4j/main/classes/core/src/com/ibm/icu/lang/UScript.java index 0569f717408..7da43c5bd18 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/lang/UScript.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/lang/UScript.java @@ -766,6 +766,7 @@ public final class UScript { * Typo, use DUPLOYAN * @deprecated ICU 54 */ + @Deprecated public static final int DUPLOYAN_SHORTAND = DUPLOYAN; /** * ISO 15924 script code diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/PluralRanges.java b/icu4j/main/classes/core/src/com/ibm/icu/text/PluralRanges.java index e45edb89ab5..659ec6747e1 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/PluralRanges.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/PluralRanges.java @@ -29,12 +29,19 @@ public final class PluralRanges implements Freezable, Comparable

, Cloneable { + @Deprecated + public PluralRanges() { + } + + /** + * Internal class for mapping from two StandardPluralCategories values to another. + */ + private static final class Matrix implements Comparable, Cloneable { private byte[] data = new byte[StandardPluralCategories.COUNT * StandardPluralCategories.COUNT]; { for (int i = 0; i < data.length; ++i) { @@ -42,24 +49,22 @@ public final class PluralRanges implements Freezable, Comparable

= 0) { @@ -72,22 +77,17 @@ public final class PluralRanges implements Freezable, Comparable

values are all the same. - * - * @internal - * @deprecated This API is ICU internal only. */ - public StandardPluralCategories endSame(StandardPluralCategories end) { + @SuppressWarnings("unused") + StandardPluralCategories endSame(StandardPluralCategories end) { StandardPluralCategories first = null; for (StandardPluralCategories start : StandardPluralCategories.VALUES) { StandardPluralCategories item = get(start, end); @@ -107,11 +107,9 @@ public final class PluralRanges implements Freezable, Comparable

values are all the same. - * - * @internal - * @deprecated This API is ICU internal only. */ - public StandardPluralCategories startSame(StandardPluralCategories start, + @SuppressWarnings("unused") + StandardPluralCategories startSame(StandardPluralCategories start, EnumSet endDone, Output emit) { emit.value = false; StandardPluralCategories first = null; @@ -196,6 +194,7 @@ public final class PluralRanges implements Freezable, Comparable

, Comparable

, Comparable

, Comparable

, Comparable

, Comparable

, Compa /** * Append the toPattern() representation of a * string to the given StringBuffer. - * @return */ private static StringBuffer _appendToPat(StringBuffer buf, String s, boolean escapeUnprintable) { int cp; @@ -615,7 +614,6 @@ public class UnicodeSet extends UnicodeFilter implements Iterable, Compa /** * Append the toPattern() representation of a * character to the given StringBuffer. - * @return */ private static StringBuffer _appendToPat(StringBuffer buf, int c, boolean escapeUnprintable) { // "Utility.isUnprintable(c)" seems redundant since the the call @@ -4116,18 +4114,36 @@ public class UnicodeSet extends UnicodeFilter implements Iterable, Compa /** * A struct-like class used for iteration through ranges, for faster iteration than by String. - * Read about the restrictions on usage in {@link #UnicodeSet.ranges()}. + * Read about the restrictions on usage in {@link UnicodeSet#ranges()}. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public static class EntryRange { /** * The starting code point of the range. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public int codepoint; /** * The ending code point of the range + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public int codepointEnd; - + + EntryRange() { + } + + /** + * {@inheritDoc} + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. + */ @Override public String toString() { StringBuffer b = new StringBuffer(); @@ -4155,6 +4171,9 @@ public class UnicodeSet extends UnicodeFilter implements Iterable, Compa * // do something with each string; * } * + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public Iterable ranges() { return new EntryRanges(); diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/UnicodeSetSpanner.java b/icu4j/main/classes/core/src/com/ibm/icu/text/UnicodeSetSpanner.java index 2ff4efee6fa..fe9291a0983 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/UnicodeSetSpanner.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/UnicodeSetSpanner.java @@ -37,6 +37,9 @@ import com.ibm.icu.util.OutputInt; * NOT_CONTAINEDxxxabcyyy| * *

The entire string is traversed. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public class UnicodeSetSpanner { @@ -48,6 +51,9 @@ public class UnicodeSetSpanner { * * @param source * the original UnicodeSet + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public UnicodeSetSpanner(UnicodeSet source) { unicodeSet = source; @@ -57,26 +63,31 @@ public class UnicodeSetSpanner { * Returns the UnicodeSet used for processing. It is frozen iff the original was. * * @return the construction set. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public UnicodeSet getUnicodeSet() { return unicodeSet; } - /* - * (non-Javadoc) + /** + * {@inheritDoc} * - * @see java.lang.Object#equals(java.lang.Object) + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ @Override public boolean equals(Object other) { return other instanceof UnicodeSetSpanner && unicodeSet.equals(((UnicodeSetSpanner) other).unicodeSet); } - /* - * (non-Javadoc) + /** + * {@inheritDoc} * - * @see java.lang.Object#hashCode() + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ @Override public int hashCode() { @@ -87,12 +98,16 @@ public class UnicodeSetSpanner { * Options for replaceFrom and countIn to control how to treat each matched span. The name is from "qualifier" as used in regex, * since it is similar to whether one is replacing [abc] by x, or [abc]* by x. * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public enum CountMethod { /** * Collapse spans. That is, modify/count the entire matching span as a single item, instead of separate * code points. * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ WHOLE_SPAN, /** @@ -105,6 +120,9 @@ public class UnicodeSetSpanner { *
  • spanning with [{ab}] will count two MIN_ELEMENTS.
  • *
  • spanning with [ab{ab}] will also count two MIN_ELEMENTS.
  • * + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ MIN_ELEMENTS, // Note: could in the future have an additional option MAX_ELEMENTS @@ -117,6 +135,9 @@ public class UnicodeSetSpanner { * @param sequence * the sequence to count characters in * @return the count. Zero if there are none. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public int countIn(CharSequence sequence) { return countIn(sequence, CountMethod.MIN_ELEMENTS, SpanCondition.SIMPLE); @@ -128,6 +149,9 @@ public class UnicodeSetSpanner { * @param sequence * the sequence to count characters in * @return the count. Zero if there are none. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public int countIn(CharSequence sequence, CountMethod quantifier) { return countIn(sequence, quantifier, SpanCondition.SIMPLE); @@ -144,6 +168,9 @@ public class UnicodeSetSpanner { * NOT_CONTAINED is the reverse. *
    WARNING: when a UnicodeSet contains strings, there may be unexpected behavior in edge cases. * @return the count. Zero if there are none. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public int countIn(CharSequence sequence, CountMethod quantifier, SpanCondition spanCondition) { int count = 0; @@ -169,6 +196,9 @@ public class UnicodeSetSpanner { * @param sequence * charsequence to replace matching spans in. * @return modified string. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public String deleteFrom(CharSequence sequence) { return replaceFrom(sequence, "", CountMethod.WHOLE_SPAN, SpanCondition.SIMPLE); @@ -182,6 +212,9 @@ public class UnicodeSetSpanner { * @param spanCondition * specify whether to modify the matching spans (CONTAINED or SIMPLE) or the non-matching (NOT_CONTAINED) * @return modified string. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public String deleteFrom(CharSequence sequence, SpanCondition spanCondition) { return replaceFrom(sequence, "", CountMethod.WHOLE_SPAN, spanCondition); @@ -196,6 +229,9 @@ public class UnicodeSetSpanner { * @param replacement * replacement sequence. To delete, use "" * @return modified string. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public String replaceFrom(CharSequence sequence, CharSequence replacement) { return replaceFrom(sequence, replacement, CountMethod.MIN_ELEMENTS, SpanCondition.SIMPLE); @@ -211,6 +247,9 @@ public class UnicodeSetSpanner { * @param quantifier * whether to treat an entire span as a match, or individual code points * @return modified string. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public String replaceFrom(CharSequence sequence, CharSequence replacement, CountMethod quantifier) { return replaceFrom(sequence, replacement, quantifier, SpanCondition.SIMPLE); @@ -229,6 +268,9 @@ public class UnicodeSetSpanner { * @param quantifier * specify whether to collapse or do codepoint by codepoint. * @return modified string. + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public String replaceFrom(CharSequence sequence, CharSequence replacement, CountMethod quantifier, SpanCondition spanCondition) { @@ -264,21 +306,29 @@ public class UnicodeSetSpanner { /** * Options for the trim() method * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public enum TrimOption { /** * Trim leading spans. * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ LEADING, /** * Trim leading and trailing spans. * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ BOTH, /** * Trim trailing spans. * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ TRAILING; } @@ -295,6 +345,8 @@ public class UnicodeSetSpanner { * * ... returns {@code "catbab"}. * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public CharSequence trim(CharSequence sequence) { return trim(sequence, TrimOption.BOTH, SpanCondition.SIMPLE); @@ -312,6 +364,8 @@ public class UnicodeSetSpanner { * * ... returns {@code "catbab"}. * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public CharSequence trim(CharSequence sequence, TrimOption trimOption) { return trim(sequence, trimOption, SpanCondition.SIMPLE); @@ -336,6 +390,9 @@ public class UnicodeSetSpanner { * @param spanCondition * SIMPLE, CONTAINED or NOT_CONTAINED * @return a subsequence + * + * @draft ICU 54 + * @provisional This is a draft API and might change in a future release of ICU. */ public CharSequence trim(CharSequence sequence, TrimOption trimOption, SpanCondition spanCondition) { int endLeadContained, startTrailContained; diff --git a/icu4j/main/classes/core/src/com/ibm/icu/util/Calendar.java b/icu4j/main/classes/core/src/com/ibm/icu/util/Calendar.java index 6c90cf7a386..c166de2b220 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/util/Calendar.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/util/Calendar.java @@ -1126,8 +1126,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable