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 + ".");
}
}
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private char[] | |
| private int | |
| private static int | |
| private static int | |
| private static int[] | |
| private static int | |
| private int | |
| private static UScriptRun. | |
| private int | |
| private int | |
| private int | |
| private int | |
| private char[] | |
| private int | |
| private int | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | UScriptRun(String
the string of characters over which to iterate. text)
Deprecated
This API is ICU internal only.
Construct a UScriptRun object which iterates over the
characters in the given string.
|
| public | UScriptRun(String
the string of characters over which to iterate. text, int the index of the first character over which to iterate start, int the number of characters over which to iterate count)
Deprecated
This API is ICU internal only.
Construct a UScriptRun object which iterates over a subrange
of the characters in the given string.
|
| public | UScriptRun(char[]
the array of characters over which to iterate. chars)
Deprecated
This API is ICU internal only.
Construct a UScriptRun object which iterates over the given
characters.
|
| public | UScriptRun(char[]
the array of characters over which to iterate. chars, int the index of the first character over which to iterate start, int the number of characters over which to iterate count)
Deprecated
This API is ICU internal only.
Construct a UScriptRun object which iterates over a subrange
of the given characters.
|
| Modifier and Type | Method and Description |
|---|---|
| private static final int | |
| private static final int | |
| private final void | |
| private static int | Returns: the index of the character in the table, or -1 if it's not there.the character for which to search. ch)Search the pairedChars array for the given character. |
| public final int | Returns: the script code for the script of the current script run.
Deprecated
This API is ICU internal only.
Get the script code for the script of the current script run.
|
| public final int | Returns: the index of the first character after the current script run.
Deprecated
This API is ICU internal only.
Get the index of the first character after the current script run.
|
| public final int | Returns: the index of the first character in the current script run.
Deprecated
This API is ICU internal only.
Get the starting index of the current script run.
|
| private static final byte | Returns: the bit number (counting from the low order bit) of the highest bit.the word in which to find the highest bit that's set. n)Find the highest bit that's set in a word. |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| public final boolean | Returns: false if there isn't another run, true if there is.
Deprecated
This API is ICU internal only.
Find the next script run.
|
| private final void | |
| private final void | |
| public final void | |
| public final void | reset(int
the index of the new first character over which to iterate start, int the new number of characters over which to iterate. count)
Deprecated
This API is ICU internal only.
Reset the iterator to iterate over the given range of the text.
|
| public final void | reset(char[]
the new array of characters over which to iterate. chars, int the index of the first character over which to iterate. start, int the number of characters over which to iterate. count)
Deprecated
This API is ICU internal only.
Reset the iterator to iterate over count characters
in chars starting at start.
|
| public final void | reset(char[]
the new array of characters over which to iterate. chars)
Deprecated
This API is ICU internal only.
Reset the iterator to iterate over the characters
in chars.
|
| public final void | reset(String
the new string of characters over which to iterate. str, int the index of the first character over which to iterate. start, int the nuber of characters over which to iterate. count)
Deprecated
This API is ICU internal only.
Reset the iterator to iterate over count characters
in text starting at start.
|
| public final void | |
| private static boolean | Returns: true if the two scripts are the same.one of the script codes. scriptOne, int the other script code. scriptTwo)Compare two script codes to see if they are in the same script. |
| private final boolean | |
| private final boolean | |
| private final void | |
| private final UScriptRun. |
| emptyCharArray | back to summary |
|---|---|
| private char[] emptyCharArray | |
| fixupCount | back to summary |
|---|---|
| private int fixupCount | |
| pairedCharExtra | back to summary |
|---|---|
| private static int pairedCharExtra | |
| pairedCharPower | back to summary |
|---|---|
| private static int pairedCharPower | |
| pairedChars | back to summary |
|---|---|
| private static int[] pairedChars | |
| PAREN_STACK_DEPTH | back to summary |
|---|---|
| private static int PAREN_STACK_DEPTH | |
| parenSP | back to summary |
|---|---|
| private int parenSP | |
| parenStack | back to summary |
|---|---|
| private static UScriptRun. | |
| pushCount | back to summary |
|---|---|
| private int pushCount | |
| scriptCode | back to summary |
|---|---|
| private int scriptCode | |
| scriptLimit | back to summary |
|---|---|
| private int scriptLimit | |
| scriptStart | back to summary |
|---|---|
| private int scriptStart | |
| text | back to summary |
|---|---|
| private char[] text | |
| textIndex | back to summary |
|---|---|
| private int textIndex | |
| textLimit | back to summary |
|---|---|
| private int textLimit | |
| textStart | back to summary |
|---|---|
| private int textStart | |
| UScriptRun | back to summary |
|---|---|
| public UScriptRun()
Deprecated This API is ICU internal only. Construct an empty
| |
| UScriptRun | back to summary |
|---|---|
| public UScriptRun(String text)
Deprecated This API is ICU internal only. Construct a | |
| UScriptRun | back to summary |
|---|---|
| public UScriptRun(String text, int start, int count)
Deprecated This API is ICU internal only. Construct a | |
| UScriptRun | back to summary |
|---|---|
| public UScriptRun(char[] chars)
Deprecated This API is ICU internal only. Construct a
| |
| UScriptRun | back to summary |
|---|---|
| public UScriptRun(char[] chars, int start, int count)
Deprecated This API is ICU internal only. Construct a
| |
| dec | back to summary |
|---|---|
| private static final int dec(int sp, int count) | |
| dec | back to summary |
|---|---|
| private static final int dec(int sp) | |
| fixup | back to summary |
|---|---|
| private final void fixup(int scrptCode) | |
| getPairIndex | back to summary |
|---|---|
| private static int getPairIndex(int ch) Search the pairedChars array for the given character.
| |
| getScriptCode | back to summary |
|---|---|
| public final int getScriptCode()
Deprecated This API is ICU internal only. Get the script code for the script of the current script run.
| |
| getScriptLimit | back to summary |
|---|---|
| public final int getScriptLimit()
Deprecated This API is ICU internal only. Get the index of the first character after the current script run.
| |
| getScriptStart | back to summary |
|---|---|
| public final int getScriptStart()
Deprecated This API is ICU internal only. Get the starting index of the current script run.
| |
| highBit | back to summary |
|---|---|
| private static final byte highBit(int n) Find the highest bit that's set in a word. Uses a binary search through the bits.
| |
| inc | back to summary |
|---|---|
| private static final int inc(int sp, int count) | |
| inc | back to summary |
|---|---|
| private static final int inc(int sp) | |
| limitInc | back to summary |
|---|---|
| private static final int limitInc(int count) | |
| mod | back to summary |
|---|---|
| private static final int mod(int sp) | |
| next | back to summary |
|---|---|
| public final boolean next()
Deprecated This API is ICU internal only. Find the next script run. Returns
| |
| pop | back to summary |
|---|---|
| private final void pop() | |
| push | back to summary |
|---|---|
| private final void push(int pairIndex, int scrptCode) | |
| reset | back to summary |
|---|---|
| public final void reset()
Deprecated This API is ICU internal only. Reset the iterator to the start of the text.
| |
| reset | back to summary |
|---|---|
| public final void reset(int start, int count) throws IllegalArgumentException
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.
| |
| reset | back to summary |
|---|---|
| public final void reset(char[] chars, int start, int count)
Deprecated This API is ICU internal only. Reset the iterator to iterate over
| |
| reset | back to summary |
|---|---|
| public final void reset(char[] chars)
Deprecated This API is ICU internal only. Reset the iterator to iterate over the characters
in
| |
| reset | back to summary |
|---|---|
| public final void reset(String str, int start, int count)
Deprecated This API is ICU internal only. Reset the iterator to iterate over | |
| reset | back to summary |
|---|---|
| public final void reset(String str)
Deprecated This API is ICU internal only. Reset the iterator to iterate over the characters
in | |
| sameScript | back to summary |
|---|---|
| private static boolean sameScript(int scriptOne, int scriptTwo) Compare two script codes to see if they are in the same script. If one script is a strong script, and the other is INHERITED or COMMON, it will compare equal.
| |
| stackIsEmpty | back to summary |
|---|---|
| private final boolean stackIsEmpty() | |
| stackIsNotEmpty | back to summary |
|---|---|
| private final boolean stackIsNotEmpty() | |
| syncFixup | back to summary |
|---|---|
| private final void syncFixup() | |
| top | back to summary |
|---|---|
| private final UScriptRun. | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv int | |
| pack-priv int |
| Access | Constructor and Description |
|---|---|
| public |
| pairIndex | back to summary |
|---|---|
| pack-priv int pairIndex | |
| scriptCode | back to summary |
|---|---|
| pack-priv int scriptCode | |
| ParenStackEntry | back to summary |
|---|---|
| public ParenStackEntry(int thePairIndex, int theScriptCode) | |