Java Code Examples for sun.text.CodePointIterator#next()

The following examples show how to use sun.text.CodePointIterator#next() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FontResolver.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 2
Source File: FontResolver.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 3
Source File: FontResolver.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 4
Source File: FontResolver.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 5
Source File: FontResolver.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 6
Source File: FontResolver.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 7
Source File: FontResolver.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 8
Source File: FontResolver.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 9
Source File: FontResolver.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 10
Source File: FontResolver.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 11
Source File: FontResolver.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}
 
Example 12
Source File: FontResolver.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Determines the font index for the code point at the current position in the
 * iterator, then advances the iterator to the first code point that has
 * a different index or until the iterator is DONE, and returns the font index.
 * @param iter a code point iterator, this will be advanced past any code
 *             points that have the same font index
 * @return the font index for the initial code point found, or 1 if the iterator
 * was empty.
 */
public int nextFontRunIndex(CodePointIterator iter) {
    int cp = iter.next();
    int fontIndex = 1;
    if (cp != CodePointIterator.DONE) {
        fontIndex = getFontIndex(cp);

        while ((cp = iter.next()) != CodePointIterator.DONE) {
            if (getFontIndex(cp) != fontIndex) {
                iter.prev();
                break;
            }
        }
    }
    return fontIndex;
}