< prev index next >
src/java.base/share/classes/jdk/internal/icu/util/CodePointMap.java
Print this page
rev 59210 : imported patch 8239383
@@ -34,29 +34,26 @@
/**
* Abstract map from Unicode code points (U+0000..U+10FFFF) to integer values.
* This does not implement java.util.Map.
*
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public abstract class CodePointMap implements Iterable<CodePointMap.Range> {
/**
* Selectors for how getRange() should report value ranges overlapping with surrogates.
* Most users should use NORMAL.
*
* @see #getRange
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public enum RangeOption {
/**
* getRange() enumerates all same-value ranges as stored in the map.
* Most users should use this option.
*
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
NORMAL,
/**
* getRange() enumerates all same-value ranges as stored in the map,
* except that lead surrogates (U+D800..U+DBFF) are treated as having the
@@ -69,12 +66,11 @@
* <p>This option is useful for maps that map surrogate code *units* to
* special values optimized for UTF-16 string processing
* or for special error behavior for unpaired surrogates,
* but those values are not to be associated with the lead surrogate code *points*.
*
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
FIXED_LEAD_SURROGATES,
/**
* getRange() enumerates all same-value ranges as stored in the map,
* except that all surrogates (U+D800..U+DFFF) are treated as having the
@@ -87,12 +83,11 @@
* <p>This option is useful for maps that map surrogate code *units* to
* special values optimized for UTF-16 string processing
* or for special error behavior for unpaired surrogates,
* but those values are not to be associated with the lead surrogate code *points*.
*
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
FIXED_ALL_SURROGATES
}
/**
@@ -104,21 +99,19 @@
* make a filter for one of several values,
* return a value index computed from the map value, etc.
*
* @see #getRange
* @see #iterator
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public interface ValueFilter {
/**
* Modifies the map value.
*
* @param value map value
* @return modified value
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public int apply(int value);
}
/**
@@ -127,56 +120,50 @@
* The value may have been modified by {@link ValueFilter#apply(int)},
* or it may be the surrogateValue if a RangeOption other than "normal" was used.
*
* @see #getRange
* @see #iterator
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public static final class Range {
private int start;
private int end;
private int value;
/**
* Constructor. Sets start and end to -1 and value to 0.
*
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public Range() {
start = end = -1;
value = 0;
}
/**
* @return the start code point
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public int getStart() { return start; }
/**
* @return the (inclusive) end code point
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public int getEnd() { return end; }
/**
* @return the range value
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public int getValue() { return value; }
/**
* Sets the range. When using {@link #iterator()},
* iteration will resume after the newly set end.
*
* @param start new start code point
* @param end new end code point
* @param value new value
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public void set(int start, int end, int value) {
this.start = start;
this.end = end;
this.value = value;
@@ -221,12 +208,11 @@
* }
* </pre>
*
* <p>This class is not intended for public subclassing.
*
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public class StringIterator {
/**
* @internal
* @deprecated This API is ICU internal only.
@@ -267,12 +253,11 @@
/**
* Resets the iterator to a new string and/or a new string index.
*
* @param s string to iterate over
* @param sIndex string index where the iteration will start
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public void reset(CharSequence s, int sIndex) {
this.s = s;
this.sIndex = sIndex;
c = -1;
@@ -284,12 +269,11 @@
* and gets a value from the map.
* Sets an implementation-defined error value if the code point is an unpaired surrogate.
*
* @return true if the string index was not yet at the end of the string;
* otherwise the iterator did not advance
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public boolean next() {
if (sIndex >= s.length()) {
return false;
}
@@ -304,12 +288,11 @@
* and gets a value from the map.
* Sets an implementation-defined error value if the code point is an unpaired surrogate.
*
* @return true if the string index was not yet at the start of the string;
* otherwise the iterator did not advance
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public boolean previous() {
if (sIndex <= 0) {
return false;
}
@@ -318,35 +301,31 @@
value = get(c);
return true;
}
/**
* @return the string index
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public final int getIndex() { return sIndex; }
/**
* @return the code point
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public final int getCodePoint() { return c; }
/**
* @return the map value,
* or an implementation-defined error value if
* the code point is an unpaired surrogate
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public final int getValue() { return value; }
}
/**
* Protected no-args constructor.
*
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
protected CodePointMap() {
}
/**
@@ -355,12 +334,11 @@
*
* @param c the code point
* @return the map value,
* or an implementation-defined error value if
* the code point is not in the range 0..U+10FFFF
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public abstract int get(int c);
/**
* Sets the range object to a range of code points beginning with the start parameter.
@@ -393,12 +371,11 @@
* @param start range start
* @param filter an object that may modify the map data value,
* or null if the values from the map are to be used unmodified
* @param range the range object that will be set to the code point range and value
* @return true if start is 0..U+10FFFF; otherwise no new range is fetched
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public abstract boolean getRange(int start, ValueFilter filter, Range range);
/**
* Sets the range object to a range of code points beginning with the start parameter.
@@ -417,12 +394,11 @@
* @param surrogateValue value for surrogates; ignored if option=={@link RangeOption#NORMAL}
* @param filter an object that may modify the map data value,
* or null if the values from the map are to be used unmodified
* @param range the range object that will be set to the code point range and value
* @return true if start is 0..U+10FFFF; otherwise no new range is fetched
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public boolean getRange(int start, RangeOption option, int surrogateValue,
ValueFilter filter, Range range) {
assert option != null;
if (!getRange(start, filter, range)) {
@@ -475,12 +451,11 @@
* Adjacent ranges have different map values.
*
* <p>The iterator always returns the same Range object.
*
* @return a Range iterator
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
@Override
public Iterator<Range> iterator() {
return new RangeIterator();
}
@@ -490,12 +465,11 @@
* for fetching map values.
*
* @param s string to iterate over
* @param sIndex string index where the iteration will start
* @return the iterator
- * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
+ * @stable ICU 63
*/
public StringIterator stringIterator(CharSequence s, int sIndex) {
return new StringIterator(s, sIndex);
}
}
< prev index next >