| Modifier and Type | Class and Description |
|---|---|
| public static class | CodePointMap.
Range iteration result data. |
| private class | |
| public static enum | CodePointMap.
Selectors for how getRange() should report value ranges overlapping with surrogates. |
| public class | CodePointMap.
Iterates over code points of a string and fetches map values. |
| public static interface | CodePointMap.
Callback function interface: Modifies a map value. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public abstract int | Returns: the map value, or an implementation-defined error value if the code point is not in the range 0..U+10FFFFthe code point c)Returns the value for a code point as stored in the map, with range checking. |
| public abstract boolean | Returns: true if start is 0..U+10FFFF; otherwise no new range is fetchedrange start start, CodePointMap.an object that may modify the map data value,
or null if the values from the map are to be used unmodified filter,the range object that will be set to the code point range and value rangeSets the range object to a range of code points beginning with the start parameter. |
| public boolean | Returns: true if start is 0..U+10FFFF; otherwise no new range is fetchedrange start start, CodePointMap.defines whether surrogates are treated normally,
or as having the surrogateValue; usually option,RangeOption#NORMALvalue for surrogates; ignored if option== surrogateValue, CodePointMap.RangeOption#NORMALan object that may modify the map data value,
or null if the values from the map are to be used unmodified filter,the range object that will be set to the code point range and value rangeSets the range object to a range of code points beginning with the start parameter. |
| public Iterator | Returns: a Range iteratorImplements java. Convenience iterator over same-map-value code point ranges. |
| public CodePointMap. | Returns: the iteratorstring to iterate over s, int string index where the iteration will start sIndex)Returns an iterator (not a java.util.Iterator) over code points of a string for fetching map values. |
| CodePointMap | back to summary |
|---|---|
| protected CodePointMap() Protected no-args constructor.
| |
| get | back to summary |
|---|---|
| public abstract int get(int c) Returns the value for a code point as stored in the map, with range checking. Returns an implementation-defined error value if c is not in the range 0..U+10FFFF.
| |
| getRange | back to summary |
|---|---|
| public abstract boolean getRange(int start, CodePointMap. Sets the range object to a range of code points beginning with the start parameter. The range start is the same as the start input parameter (even if there are preceding code points that have the same value). The range end is the last code point such that all those from start to there have the same value. Returns false if start is not 0..U+10FFFF. Can be used to efficiently iterate over all same-value ranges in a map. (This is normally faster than iterating over code points and get()ting each value, but may be much slower than a data structure that stores ranges directly.) If the Example:
int start = 0;
CodePointMap.Range range = new CodePointMap.Range();
while (map.getRange(start, null, range)) {
int end = range.getEnd();
int value = range.getValue();
// Work with the range start..end and its value.
start = end + 1;
}
| |
| getRange | back to summary |
|---|---|
| public boolean getRange(int start, CodePointMap. Sets the range object to a range of code points beginning with the start parameter. The range start is the same as the start input parameter (even if there are preceding code points that have the same value). The range end is the last code point such that all those from start to there have the same value. Returns false if start is not 0..U+10FFFF. Same as the simpler
| |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Convenience iterator over same-map-value code point ranges.
Same as looping over all ranges with The iterator always returns the same Range object.
| |
| stringIterator | back to summary |
|---|---|
| public CodePointMap. Returns an iterator (not a java.util.Iterator) over code points of a string for fetching map values.
| |
ValueFilter#apply(int),
or it may be the surrogateValue if a RangeOption other than "normal" was used.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public int | |
| public int | |
| public void |
| end | back to summary |
|---|---|
| private int end | |
| start | back to summary |
|---|---|
| private int start | |
| value | back to summary |
|---|---|
| private int value | |
| Range | back to summary |
|---|---|
| public Range() Constructor. Sets start and end to -1 and value to 0.
| |
| getEnd | back to summary |
|---|---|
public int getEnd()
| |
| getStart | back to summary |
|---|---|
public int getStart()
| |
| getValue | back to summary |
|---|---|
public int getValue()
| |
| set | back to summary |
|---|---|
| public void set(int start, int end, int value) Sets the range. When using
| |
| Modifier and Type | Field and Description |
|---|---|
| private CodePointMap. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public CodePointMap. | |
| public final void | remove()
Overrides default java. Removes from the underlying collection the last element returned by this iterator (optional operation). |
| range | back to summary |
|---|---|
| private CodePointMap. | |
| RangeIterator | back to summary |
|---|---|
| private RangeIterator() | |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public CodePointMap. Implements java. Doc from java. Returns the next element in the iteration.
| |
| remove | back to summary |
|---|---|
| public final void remove() Overrides default java. Doc from java. Removes from the underlying collection the last element returned
by this iterator (optional operation). This method can be called
only once per call to The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method, unless an overriding class has specified a concurrent modification policy.
The behavior of an iterator is unspecified if this method is called
after a call to the
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final CodePointMap. | FIXED_ALL_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 surrogateValue, which is passed to getRange() as a separate parameter. |
| public static final CodePointMap. | FIXED_LEAD_SURROGATES
getRange() enumerates all same-value ranges as stored in the map, except that lead surrogates (U+D800..U+DBFF) are treated as having the surrogateValue, which is passed to getRange() as a separate parameter. |
| public static final CodePointMap. | NORMAL
getRange() enumerates all same-value ranges as stored in the map. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static CodePointMap. | |
| public static CodePointMap. |
| FIXED_ALL_SURROGATES | back to summary |
|---|---|
| public static final CodePointMap. getRange() enumerates all same-value ranges as stored in the map,
except that all surrogates (U+D800..U+DFFF) are treated as having the
surrogateValue, which is passed to getRange() as a separate parameter.
The surrogateValue is not transformed via filter().
See Most users should use NORMAL instead. 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.
| |
| FIXED_LEAD_SURROGATES | back to summary |
|---|---|
| public static final CodePointMap. getRange() enumerates all same-value ranges as stored in the map,
except that lead surrogates (U+D800..U+DBFF) are treated as having the
surrogateValue, which is passed to getRange() as a separate parameter.
The surrogateValue is not transformed via filter().
See Most users should use NORMAL instead. 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.
| |
| NORMAL | back to summary |
|---|---|
| public static final CodePointMap. getRange() enumerates all same-value ranges as stored in the map. Most users should use this option.
| |
| RangeOption | back to summary |
|---|---|
| private RangeOption() | |
| valueOf | back to summary |
|---|---|
| public static CodePointMap. | |
| values | back to summary |
|---|---|
| public static CodePointMap. | |
void onString(CodePointMap map, CharSequence s, int start) {
CodePointMap.StringIterator iter = map.stringIterator(s, start);
while (iter.next()) {
int end = iter.getIndex(); // code point from between start and end
useValue(s, start, end, iter.getCodePoint(), iter.getValue());
start = end;
}
}
This class is not intended for public subclassing.
| Modifier and Type | Field and Description |
|---|---|
| protected int | c
Deprecated
This API is ICU internal only.
|
| protected CharSequence | s
Deprecated
This API is ICU internal only.
|
| protected int | sIndex
Deprecated
This API is ICU internal only.
|
| protected int | value
Deprecated
This API is ICU internal only.
|
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final int | |
| public final int | |
| public final int | getValue()
Returns: the map value, or an implementation-defined error value if the code point is an unpaired surrogate |
| public boolean | Returns: true if the string index was not yet at the end of the string; otherwise the iterator did not advanceReads the next code point, post-increments the string index, and gets a value from the map. |
| public boolean | Returns: true if the string index was not yet at the start of the string; otherwise the iterator did not advanceReads the previous code point, pre-decrements the string index, and gets a value from the map. |
| public void | reset(CharSequence
string to iterate over s, int string index where the iteration will start sIndex)Resets the iterator to a new string and/or a new string index. |
| c | back to summary |
|---|---|
| protected int c
Deprecated This API is ICU internal only.
| |
| s | back to summary |
|---|---|
| protected CharSequence s
Deprecated This API is ICU internal only.
| |
| sIndex | back to summary |
|---|---|
| protected int sIndex
Deprecated This API is ICU internal only.
| |
| value | back to summary |
|---|---|
| protected int value
Deprecated This API is ICU internal only.
| |
| StringIterator | back to summary |
|---|---|
| protected StringIterator(CharSequence s, int sIndex)
Deprecated This API is ICU internal only.
| |
| getCodePoint | back to summary |
|---|---|
public final int getCodePoint()
| |
| getIndex | back to summary |
|---|---|
public final int getIndex()
| |
| getValue | back to summary |
|---|---|
public final int getValue()
| |
| next | back to summary |
|---|---|
| public boolean next() Reads the next code point, post-increments the string index, and gets a value from the map. Sets an implementation-defined error value if the code point is an unpaired surrogate.
| |
| previous | back to summary |
|---|---|
| public boolean previous() Reads the previous code point, pre-decrements the string index, and gets a value from the map. Sets an implementation-defined error value if the code point is an unpaired surrogate.
| |
| reset | back to summary |
|---|---|
| public void reset(CharSequence s, int sIndex) Resets the iterator to a new string and/or a new string index.
| |
Can be used to ignore some of the value bits, make a filter for one of several values, return a value index computed from the map value, etc.
| Modifier and Type | Method and Description |
|---|---|
| public int |
| apply | back to summary |
|---|---|
| public int apply(int value) Modifies the map value.
| |