Class UScriptRun
java.lang.Object
com.ibm.icu.lang.UScriptRun
Deprecated.
This API is ICU internal only.
UScriptRun is used to find runs of characters in the same script, as defined in the
UScript class. It implements a simple iterator over an array of characters. The
iterator will assign COMMON and INHERITED characters to the same script
as the preceding characters. If the COMMON and INHERITED characters are first, they will be
assigned to the same script as the following characters.
The iterator will try to match paired punctuation. If it sees an opening punctuation character, it will remember the script that was assigned to that character, and assign the same script to the matching closing punctuation.
No attempt is made to combine related scripts into a single run. In particular, Hiragana, Katakana, and Han characters will appear in separate runs.
Here is an example of how to iterate over script runs:
void printScriptRuns(char[] text)
{
UScriptRun scriptRun = new UScriptRun(text);
while (scriptRun.next()) {
int start = scriptRun.getScriptStart();
int limit = scriptRun.getScriptLimit();
int script = scriptRun.getScriptCode();
System.out.println("Script \"" + UScript.getName(script) + "\" from " +
start + " to " + limit + ".");
}
}
- Status:
- Internal. This API is ICU internal only.
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.This API is ICU internal only.UScriptRun(char[] chars) Deprecated.This API is ICU internal only.UScriptRun(char[] chars, int start, int count) Deprecated.This API is ICU internal only.UScriptRun(String text) Deprecated.This API is ICU internal only.UScriptRun(String text, int start, int count) Deprecated.This API is ICU internal only. -
Method Summary
Modifier and TypeMethodDescriptionfinal intDeprecated.This API is ICU internal only.final intDeprecated.This API is ICU internal only.final intDeprecated.This API is ICU internal only.final booleannext()Deprecated.This API is ICU internal only.final voidreset()Deprecated.This API is ICU internal only.final voidreset(char[] chars) Deprecated.This API is ICU internal only.final voidreset(char[] chars, int start, int count) Deprecated.This API is ICU internal only.final voidreset(int start, int count) Deprecated.This API is ICU internal only.final voidDeprecated.This API is ICU internal only.final voidDeprecated.This API is ICU internal only.
-
Constructor Details
-
UScriptRun
Deprecated.This API is ICU internal only.Construct an emptyUScriptRunobject. Thenext()method will returnfalsethe first time it is called.- Status:
- Internal. This API is ICU internal only.
-
UScriptRun
Deprecated.This API is ICU internal only.Construct aUScriptRunobject which iterates over the characters in the given string.- Parameters:
text- the string of characters over which to iterate.- Status:
- Internal. This API is ICU internal only.
-
UScriptRun
Deprecated.This API is ICU internal only.Construct aUScriptRunobject which iterates over a subrange of the characters in the given string.- Parameters:
text- the string of characters over which to iterate.start- the index of the first character over which to iteratecount- the number of characters over which to iterate- Status:
- Internal. This API is ICU internal only.
-
UScriptRun
Deprecated.This API is ICU internal only.Construct aUScriptRunobject which iterates over the given characters.- Parameters:
chars- the array of characters over which to iterate.- Status:
- Internal. This API is ICU internal only.
-
UScriptRun
Deprecated.This API is ICU internal only.Construct aUScriptRunobject which iterates over a subrange of the given characters.- Parameters:
chars- the array of characters over which to iterate.start- the index of the first character over which to iteratecount- the number of characters over which to iterate- Status:
- Internal. This API is ICU internal only.
-
-
Method Details
-
reset
Deprecated.This API is ICU internal only.Reset the iterator to the start of the text.- Status:
- Internal. This API is ICU internal only.
-
reset
Deprecated.This API is ICU internal only.Reset the iterator to iterate over the given range of the text. Throws IllegalArgumentException if the range is outside of the bounds of the character array.- Parameters:
start- the index of the new first character over which to iteratecount- the new number of characters over which to iterate.- Throws:
IllegalArgumentException- If invalid arguments are passed.- Status:
- Internal. This API is ICU internal only.
-
reset
Deprecated.This API is ICU internal only.Reset the iterator to iterate overcountcharacters incharsstarting atstart. This allows clients to reuse an iterator.- Parameters:
chars- the new array of characters over which to iterate.start- the index of the first character over which to iterate.count- the number of characters over which to iterate.- Status:
- Internal. This API is ICU internal only.
-
reset
Deprecated.This API is ICU internal only.Reset the iterator to iterate over the characters inchars. This allows clients to reuse an iterator.- Parameters:
chars- the new array of characters over which to iterate.- Status:
- Internal. This API is ICU internal only.
-
reset
Deprecated.This API is ICU internal only.Reset the iterator to iterate overcountcharacters intextstarting atstart. This allows clients to reuse an iterator.- Parameters:
str- the new string of characters over which to iterate.start- the index of the first character over which to iterate.count- the nuber of characters over which to iterate.- Status:
- Internal. This API is ICU internal only.
-
reset
Deprecated.This API is ICU internal only.Reset the iterator to iterate over the characters intext. This allows clients to reuse an iterator.- Parameters:
str- the new string of characters over which to iterate.- Status:
- Internal. This API is ICU internal only.
-
getScriptStart
Deprecated.This API is ICU internal only.Get the starting index of the current script run.- Returns:
- the index of the first character in the current script run.
- Status:
- Internal. This API is ICU internal only.
-
getScriptLimit
Deprecated.This API is ICU internal only.Get the index of the first character after the current script run.- Returns:
- the index of the first character after the current script run.
- Status:
- Internal. This API is ICU internal only.
-
getScriptCode
Deprecated.This API is ICU internal only.Get the script code for the script of the current script run.- Returns:
- the script code for the script of the current script run.
- See Also:
- Status:
- Internal. This API is ICU internal only.
-
next
Deprecated.This API is ICU internal only.Find the next script run. Returnsfalseif there isn't another run, returnstrueif there is.- Returns:
falseif there isn't another run,trueif there is.- Status:
- Internal. This API is ICU internal only.
-